1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/testing/selftests/kvm/lib/x86_64
Andrei Vagin 281106f938 selftests: kvm: set rax before vmcall
kvm_hypercall has to place the hypercall number in rax.

Trace events show that kvm_pv_test doesn't work properly:
     kvm_pv_test-53132: kvm_hypercall: nr 0x0 a0 0x0 a1 0x0 a2 0x0 a3 0x0
     kvm_pv_test-53132: kvm_hypercall: nr 0x0 a0 0x0 a1 0x0 a2 0x0 a3 0x0
     kvm_pv_test-53132: kvm_hypercall: nr 0x0 a0 0x0 a1 0x0 a2 0x0 a3 0x0

With this change, it starts working as expected:
     kvm_pv_test-54285: kvm_hypercall: nr 0x5 a0 0x0 a1 0x0 a2 0x0 a3 0x0
     kvm_pv_test-54285: kvm_hypercall: nr 0xa a0 0x0 a1 0x0 a2 0x0 a3 0x0
     kvm_pv_test-54285: kvm_hypercall: nr 0xb a0 0x0 a1 0x0 a2 0x0 a3 0x0

Signed-off-by: Andrei Vagin <avagin@google.com>
Message-Id: <20220722230241.1944655-5-avagin@google.com>
Fixes: ac4a4d6de2 ("selftests: kvm: test enforcement of paravirtual cpuid features")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-08-01 08:43:05 -04:00
..
apic.c KVM: selftests: Introduce x2APIC register manipulation functions 2021-06-17 13:09:32 -04:00
handlers.S selftests: kvm: remove reassignment of non-absolute variables 2021-05-07 06:06:13 -04:00
perf_test_util.c KVM: selftests: Use kvm_cpu_has() for nested VMX checks 2022-07-13 18:14:10 -07:00
processor.c selftests: kvm: set rax before vmcall 2022-08-01 08:43:05 -04:00
svm.c KVM: selftests: Use kvm_cpu_has() for nested SVM checks 2022-07-13 18:14:10 -07:00
ucall.c KVM: selftests: Purge vm+vcpu_id == vcpu silliness 2022-06-11 11:47:22 -04:00
vmx.c KVM: selftests: Use kvm_cpu_has() for nested VMX checks 2022-07-13 18:14:10 -07:00