linux/tools/testing/selftests/kvm/lib
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
..
aarch64 Merge remote-tracking branch 'kvm/next' into kvm-next-5.20 2022-08-01 03:21:00 -04:00
riscv KVM: selftests: Purge vm+vcpu_id == vcpu silliness 2022-06-11 11:47:22 -04:00
s390x KVM: selftests: Add kvm_has_cap() to provide syntactic sugar 2022-06-11 11:47:28 -04:00
x86_64 selftests: kvm: set rax before vmcall 2022-08-01 08:43:05 -04:00
assert.c KVM: selftests: Print the errno besides error-string in TEST_ASSERT 2021-04-20 04:18:52 -04:00
elf.c KVM: selftests: Get rid of kvm_util_internal.h 2022-06-11 11:46:19 -04:00
guest_modes.c KVM: selftests: Sanity check input to ioctls() at build time 2022-06-11 11:48:09 -04:00
io.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
kvm_util.c KVM: selftests: Cache CPUID in struct kvm_vcpu 2022-07-13 18:14:15 -07:00
perf_test_util.c KVM: selftests: Drop @num_percpu_pages from __vm_create_with_vcpus() 2022-06-11 11:47:25 -04:00
rbtree.c KVM: selftests: Keep track of memslots more efficiently 2021-05-27 07:45:54 -04:00
sparsebit.c kvm: selftests: Fix spelling mistake "missmatch" -> "mismatch" 2021-09-30 04:27:08 -04:00
test_util.c KVM: selftests: Assert mmap HVA is aligned when using HugeTLB 2021-11-16 07:43:25 -05:00