diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-07-07 08:58:23 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-07 08:58:23 +0200 |
commit | 3ebe3bd8fbd51b5e04e93c7f3fb90bd096a86344 (patch) | |
tree | 41b67e7a92f1935b1d5acdc714de1b13f657b7af /arch/x86/include/asm/pvclock.h | |
parent | Merge tag 'perf-core-for-mingo-20160704' of git://git.kernel.org/pub/scm/linu... (diff) | |
parent | perf/core: Fix pmu::filter_match for SW-led groups (diff) | |
download | linux-3ebe3bd8fbd51b5e04e93c7f3fb90bd096a86344.tar.xz linux-3ebe3bd8fbd51b5e04e93c7f3fb90bd096a86344.zip |
Merge branch 'perf/urgent' into perf/core, to pick up fixes before merging new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/pvclock.h')
-rw-r--r-- | arch/x86/include/asm/pvclock.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h index fdcc04020636..7c1c89598688 100644 --- a/arch/x86/include/asm/pvclock.h +++ b/arch/x86/include/asm/pvclock.h @@ -69,29 +69,22 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift) } static __always_inline -u64 pvclock_get_nsec_offset(const struct pvclock_vcpu_time_info *src) -{ - u64 delta = rdtsc_ordered() - src->tsc_timestamp; - return pvclock_scale_delta(delta, src->tsc_to_system_mul, - src->tsc_shift); -} - -static __always_inline unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src, cycle_t *cycles, u8 *flags) { unsigned version; - cycle_t ret, offset; - u8 ret_flags; + cycle_t offset; + u64 delta; version = src->version; + /* Make the latest version visible */ + smp_rmb(); - offset = pvclock_get_nsec_offset(src); - ret = src->system_time + offset; - ret_flags = src->flags; - - *cycles = ret; - *flags = ret_flags; + delta = rdtsc_ordered() - src->tsc_timestamp; + offset = pvclock_scale_delta(delta, src->tsc_to_system_mul, + src->tsc_shift); + *cycles = src->system_time + offset; + *flags = src->flags; return version; } |