]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: selftests: Use a loop to walk guest page tables
authorJim Mattson <jmattson@google.com>
Tue, 28 Oct 2025 22:30:40 +0000 (15:30 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 21 Nov 2025 00:19:59 +0000 (16:19 -0800)
commit2103a8baf5cb7e6169434e5f2cc6c311929f529a
treee8244d58599165e375b43d576ceb2bb151a43850
parentae5b498b8da96749cdad7b5a013053d17d815a6e
KVM: selftests: Use a loop to walk guest page tables

Walk the guest page tables via a loop when searching for a PTE,
instead of using unique variables for each level of the page tables.

This simplifies the code and makes it easier to support 5-level paging
in the future.

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20251028225827.2269128-3-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/lib/x86/processor.c