[PATCH v2 3/9] KVM: selftests: nx_huge_pages_test: Add TDP detection for Zhaoxin CPUs
From: Ewan Hai-oc
Date: Thu Sep 10 2026 - 08:05:52 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 Zhaoxin 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 Zhaoxin
CPUs before querying the EPT parameter, maintaining compatibility
with existing Intel systems while extending support to Zhaoxin CPU
systems.
Signed-off-by: Frank Zhu <frankzhu@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 a183cf005..bd50c1265 100644
--- a/tools/testing/selftests/kvm/lib/x86/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86/processor.c
@@ -160,7 +160,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_compatible)
return get_kvm_intel_param_bool("ept");
else
return get_kvm_amd_param_bool("npt");
--
2.34.1