]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: selftests: Plumb "struct kvm_mmu" into x86's MMU APIs
authorSean Christopherson <seanjc@google.com>
Tue, 30 Dec 2025 23:01:36 +0000 (15:01 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 8 Jan 2026 20:02:08 +0000 (12:02 -0800)
commit11825209f5494098da6cab666d8a767650c1c0cb
tree1c633572d4ef4e114e7d34fc293b0eb6aa5c0c8f
parent9f073ac25b4c4cf3b3ea13b155035108c54148bb
KVM: selftests: Plumb "struct kvm_mmu" into x86's MMU APIs

In preparation for generalizing the x86 virt mapping APIs to work with
TDP (stage-2) page tables, plumb "struct kvm_mmu" into all of the helper
functions instead of operating on vm->mmu directly.

Opportunistically swap the order of the check in virt_get_pte() to first
assert that the parent is the PGD, and then check that the PTE is present,
as it makes more sense to check if the parent PTE is the PGD/root (i.e.
not a PTE) before checking that the PTE is PRESENT.

No functional change intended.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
[sean: rebase on common kvm_mmu structure, rewrite changelog]
Link: https://patch.msgid.link/20251230230150.4150236-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86/processor.h
tools/testing/selftests/kvm/lib/x86/processor.c