Skip to content

KVM: x86/mmu: A/D cleanups (on top of kvm_follow_pfn)

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 mmu, with Paolo's suggestions (the guard(rcu) trick in

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/18KVM: x86/mmu: Flush remote TLBs iff MMU-writable flag is cleared from RO SPTEarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.c+7 -110 replies
2/18KVM: x86/mmu: Always set SPTE's dirty bit if it's created as writablearch/x86/kvm/mmu/spte.c+9 -190 replies
3/18KVM: x86/mmu: Fold all of make_spte()'s writable handling into one if-elsearch/x86/kvm/mmu/spte.c+4 -90 replies
4/18KVM: x86/mmu: Don't force flush if SPTE update clears Accessed bitarch/x86/kvm/mmu/mmu.c+9 -210 replies
5/18KVM: x86/mmu: Don't flush TLBs when clearing Dirty bit in shadow MMUarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.h+8 -130 replies
6/18KVM: x86/mmu: Drop ignored return value from kvm_tdp_mmu_clear_dirty_slot()arch/x86/kvm/mmu/tdp_mmu.c arch/x86/kvm/mmu/tdp_mmu.h+7 -150 replies
7/18KVM: x86/mmu: Fold mmu_spte_update_no_track() into mmu_spte_update()arch/x86/kvm/mmu/mmu.c+21 -290 replies
8/18KVM: x86/mmu: WARN and flush if resolving a TDP MMU fault clears MMU-writablearch/x86/kvm/mmu/tdp_mmu.c+3 -10 replies
9/18KVM: x86/mmu: Add a dedicated flag to track if A/D bits are globally enabledarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.c arch/x86/kvm/mmu/spte.h +1 more+20 -160 replies
10/18KVM: x86/mmu: Set shadow_accessed_mask for EPT even if A/D bits disabledarch/x86/kvm/mmu/spte.c+1 -10 replies
11/18KVM: x86/mmu: Set shadow_dirty_mask for EPT even if A/D bits disabledarch/x86/kvm/mmu/spte.c+1 -10 replies
12/18KVM: x86/mmu: Use Accessed bit even when _hardware_ A/D bits are disabledarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.c arch/x86/kvm/mmu/spte.h+5 -130 replies
13/18KVM: x86/mmu: Process only valid TDP MMU roots when aging a gfn rangearch/x86/kvm/mmu/tdp_mmu.c+4 -20 replies
14/18KVM: x86/mmu: Stop processing TDP MMU roots for test_age if young SPTE foundarch/x86/kvm/mmu/tdp_mmu.c+40 -441 reply
15/18KVM: x86/mmu: Dedup logic for detecting TLB flushes on leaf SPTE changesarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.h arch/x86/kvm/mmu/tdp_mmu.c+31 -201 reply
16/18KVM: x86/mmu: Set Dirty bit for new SPTEs, even if _hardware_ A/D bits are disabledarch/x86/kvm/mmu/spte.c arch/x86/kvm/mmu/spte.h+1 -70 replies
17/18KVM: Allow arch code to elide TLB flushes when aging a young pagevirt/kvm/Kconfig virt/kvm/kvm_main.c+10 -140 replies
18/18KVM: x86: Don't emit TLB flushes when aging SPTEs for mmu_notifiersarch/x86/kvm/Kconfig arch/x86/kvm/mmu/spte.h+3 -30 replies

Reviews trailers per patch

None of the 18 patches has a Reviewed-by or Acked-by.

PatchAlex Bennée
1/18
2/18
3/18
4/18T-b
5/18
6/18
7/18
8/18
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/18] KVM: x86/mmu: A/D cleanups (on top of kvm_follow_pfn)

This is effectively an extensive of the kvm_follow_pfn series[*] (and applies on top of said series), but is x86-specific and is *almost* entirely related to Accessed and Dirty bits.

There's no central theme beyond cleaning up things that were discovered when digging deep for the kvm_follow_pfn overhaul, and to a lesser extent the series to add MGLRU support in KVM x86.

[*] https://lore.kernel.org/all/[email protected]

Sean Christopherson (18):
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

 arch/x86/kvm/Kconfig       |   1 +
 arch/x86/kvm/mmu/mmu.c     |  72 +++++++-----------------
 arch/x86/kvm/mmu/spte.c    |  59 ++++++++------------
 arch/x86/kvm/mmu/spte.h    |  72 ++++++++++++------------
 arch/x86/kvm/mmu/tdp_mmu.c | 109 +++++++++++++++++--------------------
 arch/x86/kvm/mmu/tdp_mmu.h |   2 +-
 virt/kvm/Kconfig           |   4 ++
 virt/kvm/kvm_main.c        |  20 ++-----
 8 files changed, 142 insertions(+), 197 deletions(-)

base-commit: 3f9cf3d569fdf7fb451294b636991291965573ce

Signature · 1 line
2.47.0.rc1.288.g06298d1525-goog