]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Use fast invalidate mechanism to zap MMIO sptes
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 13 Sep 2019 02:46:04 +0000 (19:46 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 24 Sep 2019 12:35:18 +0000 (14:35 +0200)
commit5399c3e923f1fdc742fef8f569b9b5d7c98cd860
tree2e7e899ab07657b8824f1d605d06af64ac3995a6
parent2e914f29b738622418e400c7b516f2784ba14e04
KVM: x86/mmu: Use fast invalidate mechanism to zap MMIO sptes

Use the fast invalidate mechasim to zap MMIO sptes on a MMIO generation
wrap.  The fast invalidate flow was reintroduced to fix a livelock bug
in kvm_mmu_zap_all() that can occur if kvm_mmu_zap_all() is invoked when
the guest has live vCPUs.  I.e. using kvm_mmu_zap_all() to handle the
MMIO generation wrap is theoretically susceptible to the livelock bug.

This effectively reverts commit e993c42e9d23c ("Revert "KVM: MMU: drop
kvm_mmu_zap_mmio_sptes""), i.e. restores the behavior of commit
c4e2fcfd24e5c ("KVM: MMU: drop kvm_mmu_zap_mmio_sptes").

Note, this actually fixes commit 2a933549e7f49 ("KVM: x86/mmu:
Voluntarily reschedule as needed when zapping MMIO sptes"), but there
is no need to incrementally revert back to using fast invalidate, e.g.
doing so doesn't provide any bisection or stability benefits.

Fixes: 2a933549e7f49 ("KVM: x86/mmu: Voluntarily reschedule as needed when zapping MMIO sptes")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c