Clean up and dedup x86 utilities that walk page tables, e.g. to insert new mappings or to retrieve existing mappings. There's no end user that benefits from the refactoring; I did all the work thinking that I needed some super fancy test to hit an NX huge page bug... Patch 1 has been posted by Vitaly (at my request)[*], but should be identical, i.e. the order shouldn't matter. [*] https://lore.kernel.org/all/20221004123956.188909-37-vkuznets@xxxxxxxxxx Sean Christopherson (7): KVM: selftests: Drop helpers to read/write page table entries KVM: selftests: Drop reserved bit checks from PTE accessor KVM: selftests: Remove useless shifts when creating guest page tables KVM: selftests: Verify parent PTE is PRESENT when getting child PTE KVM: selftests: Use virt_get_pte() when getting PTE pointer KVM: selftests: Use vm_get_page_table_entry() in addr_arch_gva2gpa() KVM: selftests: Play nice with huge pages when getting PTEs/GPAs .../selftests/kvm/include/x86_64/processor.h | 19 ++- .../selftests/kvm/lib/x86_64/processor.c | 159 ++++++------------ .../kvm/x86_64/emulator_error_test.c | 8 +- 3 files changed, 70 insertions(+), 116 deletions(-) base-commit: e18d6152ff0f41b7f01f9817372022df04e0d354 -- 2.38.0.rc1.362.ged0d419d3c-goog