diff options
author | Minfei Huang <mnghuan@gmail.com> | 2016-05-28 20:27:43 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-06-27 15:12:15 +0200 |
commit | ed911b43adb889c37a37fa57a995f0b460c633b6 (patch) | |
tree | 8ddec33ffec607c9255063dfd388c6b69249a378 /arch/x86 | |
parent | f7550d076d55c1b5f02f95012e3a5a84d264c47d (diff) | |
download | linux-stable-ed911b43adb889c37a37fa57a995f0b460c633b6.tar.gz linux-stable-ed911b43adb889c37a37fa57a995f0b460c633b6.tar.bz2 linux-stable-ed911b43adb889c37a37fa57a995f0b460c633b6.zip |
pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags
There is a generic function __pvclock_read_cycles to be used to get both
flags and cycles. For function pvclock_read_flags, it's useless to get
cycles value. To make this function be more effective, get this variable
flags directly in function.
Signed-off-by: Minfei Huang <mnghuan@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/pvclock.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index 7f82fe0a6807..06c58ce46762 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c @@ -61,11 +61,14 @@ void pvclock_resume(void) u8 pvclock_read_flags(struct pvclock_vcpu_time_info *src) { unsigned version; - cycle_t ret; u8 flags; do { - version = __pvclock_read_cycles(src, &ret, &flags); + version = src->version; + /* Make the latest version visible */ + smp_rmb(); + + flags = src->flags; /* Make sure that the version double-check is last. */ smp_rmb(); } while ((src->version & 1) || version != src->version); |