[PATCH 4/8] KVM: selftests: fix_hypercall_test: Add Zhaoxin CPU support

From: Ewan Hai-oc

Date: Thu Jul 30 2026 - 07:38:08 EST


From: Frank Zhu <frankzhu@xxxxxxxxxxx>

Zhaoxin CPUs offer a VMX-compatible interface with the same VMCALL
instruction as Intel CPUs for hypercalls. Add host_cpu_is_zx to the
Intel branch to allow the test to run correctly on Zhaoxin hardware.

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

diff --git a/tools/testing/selftests/kvm/x86/fix_hypercall_test.c b/tools/testing/selftests/kvm/x86/fix_hypercall_test.c
index 753a0e730ea8..0fb75ad1715f 100644
--- a/tools/testing/selftests/kvm/x86/fix_hypercall_test.c
+++ b/tools/testing/selftests/kvm/x86/fix_hypercall_test.c
@@ -49,7 +49,7 @@ static void guest_main(void)
const u8 *other_hypercall_insn;
u64 ret;

- if (host_cpu_is_intel) {
+ if (host_cpu_is_intel || host_cpu_is_zx) {
native_hypercall_insn = vmx_vmcall;
other_hypercall_insn = svm_vmmcall;
} else if (host_cpu_is_amd_compatible) {
--
2.34.1