Skip to content

Commit 758ccc8

Browse files
Xiao GuangrongGleb Natapov
authored andcommitted
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 7aa81cc 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 <[email protected]> Reviewed-by: Marcelo Tosatti <[email protected]> Signed-off-by: Gleb Natapov <[email protected]>
1 parent 6ea34c9 commit 758ccc8

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

arch/x86/kvm/x86.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,13 +5523,6 @@ static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt)
55235523
char instruction[3];
55245524
unsigned long rip = kvm_rip_read(vcpu);
55255525

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-
55335526
kvm_x86_ops->patch_hypercall(vcpu, instruction);
55345527

55355528
return emulator_write_emulated(ctxt, rip, instruction, 3, NULL);

0 commit comments

Comments
 (0)