Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: x86/mmu: Use leaf-only loop for walking TDP SPTEs when changing SPTE

Use the leaf-only TDP iterator when changing the SPTE in reaction to a
MMU notifier. Practically speaking, this is a nop since the guts of the
loop explicitly looks for 4k SPTEs, which are always leaf SPTEs. Switch
the iterator to match age_gfn_range() and test_age_gfn() so that a future
patch can consolidate the core iterating logic.

No real functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210326021957.1424875-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Sean Christopherson and committed by
Paolo Bonzini
aaaac889 a3f15bda

+1 -1
+1 -1
arch/x86/kvm/mmu/tdp_mmu.c
··· 1037 1037 1038 1038 new_pfn = pte_pfn(*ptep); 1039 1039 1040 - tdp_root_for_each_pte(iter, root, gfn, gfn + 1) { 1040 + tdp_root_for_each_leaf_pte(iter, root, gfn, gfn + 1) { 1041 1041 if (iter.level != PG_LEVEL_4K) 1042 1042 continue; 1043 1043