mbox series

[GIT,PULL] KVM: x86: MMU changes for 6.13

Message ID 20241112193335.597514-4-seanjc@google.com (mailing list archive)
State New
Headers show
Series [GIT,PULL] KVM: x86: MMU changes for 6.13 | expand

Pull-request

https://github.com/kvm-x86/linux.git tags/kvm-x86-mmu-6.13

Message

Sean Christopherson Nov. 12, 2024, 7:33 p.m. UTC
Aside from the A/D overhaul that you've already seen, the two highlights
are support for recovering TDP MMU huge pages in-place, and removal of KVM's
MMU shrinker (which IMO is long overdue).

The following changes since commit 5cb1659f412041e4780f2e8ee49b2e03728a2ba6:

  Merge branch 'kvm-no-struct-page' into HEAD (2024-10-25 13:38:16 -0400)

are available in the Git repository at:

  https://github.com/kvm-x86/linux.git tags/kvm-x86-mmu-6.13

for you to fetch changes up to 4cf20d42543cff8778f70b0c29def984098641a5:

  KVM: x86/mmu: Drop per-VM zapped_obsolete_pages list (2024-11-04 19:22:53 -0800)

----------------------------------------------------------------
KVM x86 MMU changes for 6.13

 - Cleanup KVM's handling of Accessed and Dirty bits to dedup code, improve
   documentation, harden against unexpected changes, and to simplify
   A/D-disabled MMUs by using the hardware-defined A/D bits to track if a
   PFN is Accessed and/or Dirty.

 - Elide TLB flushes when aging SPTEs, as has been done in x86's primary
   MMU for over 10 years.

 - Batch TLB flushes when zapping collapsible TDP MMU SPTEs, i.e. when
   dirty logging is toggled off, which reduces the time it takes to disable
   dirty logging by ~3x.

 - Recover huge pages in-place in the TDP MMU instead of zapping the SP
   and waiting until the page is re-accessed to create a huge mapping.
   Proactively installing huge pages can reduce vCPU jitter in extreme
   scenarios.

 - Remove support for (poorly) reclaiming page tables in shadow MMUs via
   the primary MMU's shrinker interface.

----------------------------------------------------------------
David Matlack (5):
      KVM: x86/mmu: Drop @max_level from kvm_mmu_max_mapping_level()
      KVM: x86/mmu: Batch TLB flushes when zapping collapsible TDP MMU SPTEs
      KVM: x86/mmu: Recover TDP MMU huge page mappings in-place instead of zapping
      KVM: x86/mmu: Rename make_huge_page_split_spte() to make_small_spte()
      KVM: x86/mmu: WARN if huge page recovery triggered during dirty logging

Sean Christopherson (21):
      KVM: x86/mmu: Flush remote TLBs iff MMU-writable flag is cleared from RO SPTE
      KVM: x86/mmu: Always set SPTE's dirty bit if it's created as writable
      KVM: x86/mmu: Fold all of make_spte()'s writable handling into one if-else
      KVM: x86/mmu: Don't force flush if SPTE update clears Accessed bit
      KVM: x86/mmu: Don't flush TLBs when clearing Dirty bit in shadow MMU
      KVM: x86/mmu: Drop ignored return value from kvm_tdp_mmu_clear_dirty_slot()
      KVM: x86/mmu: Fold mmu_spte_update_no_track() into mmu_spte_update()
      KVM: x86/mmu: WARN and flush if resolving a TDP MMU fault clears MMU-writable
      KVM: x86/mmu: Add a dedicated flag to track if A/D bits are globally enabled
      KVM: x86/mmu: Set shadow_accessed_mask for EPT even if A/D bits disabled
      KVM: x86/mmu: Set shadow_dirty_mask for EPT even if A/D bits disabled
      KVM: x86/mmu: Use Accessed bit even when _hardware_ A/D bits are disabled
      KVM: x86/mmu: Process only valid TDP MMU roots when aging a gfn range
      KVM: x86/mmu: Stop processing TDP MMU roots for test_age if young SPTE found
      KVM: x86/mmu: Dedup logic for detecting TLB flushes on leaf SPTE changes
      KVM: x86/mmu: Set Dirty bit for new SPTEs, even if _hardware_ A/D bits are disabled
      KVM: Allow arch code to elide TLB flushes when aging a young page
      KVM: x86: Don't emit TLB flushes when aging SPTEs for mmu_notifiers
      KVM: x86/mmu: Check yielded_gfn for forward progress iff resched is needed
      KVM: x86/mmu: Demote the WARN on yielded in xxx_cond_resched() to KVM_MMU_WARN_ON
      KVM: x86/mmu: Refactor TDP MMU iter need resched check

Vipin Sharma (2):
      KVM: x86/mmu: Remove KVM's MMU shrinker
      KVM: x86/mmu: Drop per-VM zapped_obsolete_pages list

 arch/x86/include/asm/kvm_host.h |   5 +-
 arch/x86/kvm/Kconfig            |   1 +
 arch/x86/kvm/mmu/mmu.c          | 201 ++++++-------------------------
 arch/x86/kvm/mmu/mmu_internal.h |   3 +-
 arch/x86/kvm/mmu/spte.c         |  99 +++++++++-------
 arch/x86/kvm/mmu/spte.h         |  76 ++++++------
 arch/x86/kvm/mmu/tdp_mmu.c      | 257 +++++++++++++++++++---------------------
 arch/x86/kvm/mmu/tdp_mmu.h      |   6 +-
 arch/x86/kvm/x86.c              |  18 ++-
 virt/kvm/Kconfig                |   4 +
 virt/kvm/kvm_main.c             |  20 +---
 11 files changed, 280 insertions(+), 410 deletions(-)