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

"Ewan Hai-oc" <[email protected]>
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
From: Frank Zhu <[email protected]>

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 <[email protected]>
Signed-off-by: Ewan Hai <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.