]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Merge branch 'kvm-memslot-zap-quirk' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Sep 2024 15:07:15 +0000 (11:07 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Sep 2024 15:38:19 +0000 (11:38 -0400)
commit55f50b2f86929ae042cd2eee8b2e8ffe00b5a885
tree233e06994cdde602da0703ba6ede84a503884ff7
parent356dab4efd1a661c7882010c34594fe9cb0048f3
parent61de4c34b51c5b9c7ef8229eb246346254638446
Merge branch 'kvm-memslot-zap-quirk' into HEAD

Today whenever a memslot is moved or deleted, KVM invalidates the entire
page tables and generates fresh ones based on the new memslot layout.

This behavior traditionally was kept because of a bug which was never
fully investigated and caused VM instability with assigned GeForce
GPUs.  It generally does not have a huge overhead, because the old
MMU is able to reuse cached page tables and the new one is more
scalabale and can resolve EPT violations/nested page faults in parallel,
but it has worse performance if the guest frequently deletes and
adds small memslots, and it's entirely not viable for TDX.  This is
because TDX requires re-accepting of private pages after page dropping.

For non-TDX VMs, this series therefore introduces the
KVM_X86_QUIRK_SLOT_ZAP_ALL quirk, enabling users to control the behavior
of memslot zapping when a memslot is moved/deleted.  The quirk is turned
on by default, leading to the zapping of all SPTEs when a memslot is
moved/deleted; users however have the option to turn off the quirk,
which limits the zapping only to those SPTEs hat lie within the range
of memslot being moved/deleted.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c