summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorPaolo Bonzini2015-07-29 11:06:34 +0200
committerPaolo Bonzini2015-07-29 14:27:23 +0200
commitc847fe8895fded71d0b9a0ba58d3828320fd1824 (patch)
tree8a2e5f7f5cf0300c3cea056c782884cfae72bde0 /arch/x86/kvm/x86.c
parentKVM: move code related to KVM_SET_BOOT_CPU_ID to x86 (diff)
downloadkernel-qcow2-linux-c847fe8895fded71d0b9a0ba58d3828320fd1824.tar.gz
kernel-qcow2-linux-c847fe8895fded71d0b9a0ba58d3828320fd1824.tar.xz
kernel-qcow2-linux-c847fe8895fded71d0b9a0ba58d3828320fd1824.zip
KVM: x86: remove unnecessary memory barriers for shared MSRs
There is no smp_rmb matching the smp_wmb. shared_msr_update is called from hardware_enable, which in turn is called via on_each_cpu. on_each_cpu and must imply a read memory barrier (on x86 the rmb is achieved simply through asm volatile in native_apic_mem_write). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c675ea3351cf..2d62229aac26 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -222,11 +222,9 @@ static void shared_msr_update(unsigned slot, u32 msr)
void kvm_define_shared_msr(unsigned slot, u32 msr)
{
BUG_ON(slot >= KVM_NR_SHARED_MSRS);
+ shared_msrs_global.msrs[slot] = msr;
if (slot >= shared_msrs_global.nr)
shared_msrs_global.nr = slot + 1;
- shared_msrs_global.msrs[slot] = msr;
- /* we need ensured the shared_msr_global have been updated */
- smp_wmb();
}
EXPORT_SYMBOL_GPL(kvm_define_shared_msr);