summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@hotmail.com>2017-04-11 02:49:21 -0700
committerRadim Krčmář <rkrcmar@redhat.com>2017-04-12 20:17:38 +0200
commit5a48a622718cbd2d26d449f38ba40a2b5f7212cf (patch)
tree990d9f540cef822b9fba710169d8a9a6cf035747 /arch/x86/kernel
parentbd8fab39cd4fe429f161dfc86bf64993d5c17320 (diff)
downloadlinux-5a48a622718cbd2d26d449f38ba40a2b5f7212cf.tar.gz
linux-5a48a622718cbd2d26d449f38ba40a2b5f7212cf.tar.bz2
linux-5a48a622718cbd2d26d449f38ba40a2b5f7212cf.zip
x86/kvm: virt_xxx memory barriers instead of mandatory barriers
virt_xxx memory barriers are implemented trivially using the low-level __smp_xxx macros, __smp_xxx is equal to a compiler barrier for strong TSO memory model, however, mandatory barriers will unconditional add memory barriers, this patch replaces the rmb() in kvm_steal_clock() by virt_rmb(). Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 14f65a5f938e..da5c09789984 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -396,9 +396,9 @@ static u64 kvm_steal_clock(int cpu)
src = &per_cpu(steal_time, cpu);
do {
version = src->version;
- rmb();
+ virt_rmb();
steal = src->steal;
- rmb();
+ virt_rmb();
} while ((version & 1) || (version != src->version));
return steal;