]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Zap only the relevant pages when removing a memslot
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 5 Feb 2019 21:01:21 +0000 (13:01 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Feb 2019 21:48:39 +0000 (22:48 +0100)
commit2955cb206c319211ab4e59f7f197fbf280e0cbbe
treedccc458d31608d0d922d8af8265bdf938dc35e23
parent3ea9d688660b034e21c818adda95dc563d17c4ec
KVM: x86/mmu: Zap only the relevant pages when removing a memslot

Modify kvm_mmu_invalidate_zap_pages_in_memslot(), a.k.a. the x86 MMU's
handler for kvm_arch_flush_shadow_memslot(), to zap only the pages/PTEs
that actually belong to the memslot being removed.  This improves
performance, especially why the deleted memslot has only a few shadow
entries, or even no entries.  E.g. a microbenchmark to access regular
memory while concurrently reading PCI ROM to trigger memslot deletion
showed a 5% improvement in throughput.

Cc: Xiao Guangrong <guangrong.xiao@gmail.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c