[PATCH 2/8] KVM: selftests: nx_huge_pages_test: Add TDP detection for Zhaoxin CPUs

From: Ewan Hai-oc

Date: Thu Jul 30 2026 - 07:47:54 EST


From: Frank Zhu <frankzhu@xxxxxxxxxxx>

Update the kvm_is_tdp_enabled() function to include Zhaoxin CPUs
when checking for EPT (Extended Page Tables) support. This ensures
that ZX CPUs use the appropriate TDP (Two-Dimensional Paging)
parameter check, similar to Intel CPUs.

The change modifies the condition to check for both Intel and ZX
CPUs before querying the EPT parameter, maintaining compatibility
with existing Intel systems while extending support to ZX CPU
systems.

Signed-off-by: Frank Zhu <frankzhu@xxxxxxxxxxx>
Signed-off-by: Ewan Hai <ewanhai-oc@xxxxxxxxxxx>
---
tools/testing/selftests/kvm/lib/x86/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/lib/x86/processor.c b/tools/testing/selftests/kvm/lib/x86/processor.c
index a8ea591ebe8e..4688cb2b0092 100644
--- a/tools/testing/selftests/kvm/lib/x86/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86/processor.c
@@ -156,7 +156,7 @@ static void sregs_dump(FILE *stream, struct kvm_sregs *sregs, u8 indent)

bool kvm_is_tdp_enabled(void)
{
- if (host_cpu_is_intel)
+ if (host_cpu_is_intel || host_cpu_is_zx)
return get_kvm_intel_param_bool("ept");
else
return get_kvm_amd_param_bool("npt");
--
2.34.1