diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2013-05-30 20:36:20 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-06-05 05:32:00 -0400 |
commit | 758ccc89b83cc15d575204091c1a1fec306245cb (patch) | |
tree | af66f3ed31cf6acec53394efe4eeabca1c815312 | |
parent | 6ea34c9b78c10289846db0abeebd6b84d5aca084 (diff) |
KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall
Quote Gleb's mail:
| Back then kvm->lock protected memslot access so code like:
|
| mutex_lock(&vcpu->kvm->lock);
| kvm_mmu_zap_all(vcpu->kvm);
| mutex_unlock(&vcpu->kvm->lock);
|
| which is what 7aa81cc0 does was enough to guaranty that no vcpu will
| run while code is patched. This is no longer the case and
| mutex_lock(&vcpu->kvm->lock); is gone from that code path long time ago,
| so now kvm_mmu_zap_all() there is useless and the code is incorrect.
So we drop it and it will be fixed later
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8d28810a5f88..6739b1d4ce7c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5523,13 +5523,6 @@ static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) | |||
5523 | char instruction[3]; | 5523 | char instruction[3]; |
5524 | unsigned long rip = kvm_rip_read(vcpu); | 5524 | unsigned long rip = kvm_rip_read(vcpu); |
5525 | 5525 | ||
5526 | /* | ||
5527 | * Blow out the MMU to ensure that no other VCPU has an active mapping | ||
5528 | * to ensure that the updated hypercall appears atomically across all | ||
5529 | * VCPUs. | ||
5530 | */ | ||
5531 | kvm_mmu_zap_all(vcpu->kvm); | ||
5532 | |||
5533 | kvm_x86_ops->patch_hypercall(vcpu, instruction); | 5526 | kvm_x86_ops->patch_hypercall(vcpu, instruction); |
5534 | 5527 | ||
5535 | return emulator_write_emulated(ctxt, rip, instruction, 3, NULL); | 5528 | return emulator_write_emulated(ctxt, rip, instruction, 3, NULL); |