[RFC PATCH 4/5] KVM: selftests: Declare __tdp_map() in the x86 processor header

From: Fred Griffoul

Date: Tue Nov 03 2026 - 19:57:26 EST


From: Fred Griffoul <fgriffo@xxxxxxxxxxxx>

Tests can only map L2 memory with 4 KiB or 1 GiB pages in the TDP page
tables L1 uses for L2, because only tdp_map() and tdp_identity_map_1g()
are declared. Declare __tdp_map(), which takes the page size, so that
tests can also use 2 MiB pages.

Signed-off-by: Fred Griffoul <fgriffo@xxxxxxxxxxxx>
---
tools/testing/selftests/kvm/include/x86/processor.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h
index 5898a277a2e0..66293e448ab2 100644
--- a/tools/testing/selftests/kvm/include/x86/processor.h
+++ b/tools/testing/selftests/kvm/include/x86/processor.h
@@ -1613,6 +1613,7 @@ void virt_map_level(struct kvm_vm *vm, gva_t gva, gpa_t gpa,

void vm_enable_tdp(struct kvm_vm *vm);
bool kvm_cpu_has_tdp(void);
+void __tdp_map(struct kvm_vm *vm, gpa_t l2_gpa, gpa_t gpa, u64 size, int level);
void tdp_map(struct kvm_vm *vm, gpa_t l2_gpa, gpa_t gpa, u64 size);
void tdp_identity_map_default_memslots(struct kvm_vm *vm);
void tdp_identity_map_1g(struct kvm_vm *vm, u64 addr, u64 size);
--
2.47.3