diff options
-rw-r--r-- | arch/x86/entry/vdso/vclock_gettime.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c index db1e3b4c3693..94d54d0defa7 100644 --- a/arch/x86/entry/vdso/vclock_gettime.c +++ b/arch/x86/entry/vdso/vclock_gettime.c | |||
@@ -96,9 +96,8 @@ static notrace cycle_t vread_pvclock(int *mode) | |||
96 | { | 96 | { |
97 | const struct pvclock_vcpu_time_info *pvti = &get_pvti0()->pvti; | 97 | const struct pvclock_vcpu_time_info *pvti = &get_pvti0()->pvti; |
98 | cycle_t ret; | 98 | cycle_t ret; |
99 | u64 tsc, pvti_tsc; | 99 | u64 last; |
100 | u64 last, delta, pvti_system_time; | 100 | u32 version; |
101 | u32 version, pvti_tsc_to_system_mul, pvti_tsc_shift; | ||
102 | 101 | ||
103 | /* | 102 | /* |
104 | * Note: The kernel and hypervisor must guarantee that cpu ID | 103 | * Note: The kernel and hypervisor must guarantee that cpu ID |
@@ -130,18 +129,9 @@ static notrace cycle_t vread_pvclock(int *mode) | |||
130 | return 0; | 129 | return 0; |
131 | } | 130 | } |
132 | 131 | ||
133 | tsc = rdtsc_ordered(); | 132 | ret = __pvclock_read_cycles(pvti); |
134 | pvti_tsc_to_system_mul = pvti->tsc_to_system_mul; | ||
135 | pvti_tsc_shift = pvti->tsc_shift; | ||
136 | pvti_system_time = pvti->system_time; | ||
137 | pvti_tsc = pvti->tsc_timestamp; | ||
138 | } while (pvclock_read_retry(pvti, version)); | 133 | } while (pvclock_read_retry(pvti, version)); |
139 | 134 | ||
140 | delta = tsc - pvti_tsc; | ||
141 | ret = pvti_system_time + | ||
142 | pvclock_scale_delta(delta, pvti_tsc_to_system_mul, | ||
143 | pvti_tsc_shift); | ||
144 | |||
145 | /* refer to vread_tsc() comment for rationale */ | 135 | /* refer to vread_tsc() comment for rationale */ |
146 | last = gtod->cycle_last; | 136 | last = gtod->cycle_last; |
147 | 137 | ||