linux/tools/testing/selftests/kvm/lib
Andrei Vagin 128eeac876 selftests: kvm: set rax before vmcall
[ Upstream commit 281106f938 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2022-08-17 14:23:59 +02:00
..
aarch64 selftests: KVM: Handle compiler optimizations in ucall 2022-08-11 13:07:51 +02:00
s390x KVM: selftests: Add wrapper to allocate page table page 2021-06-24 11:47:49 -04:00
x86_64 selftests: kvm: set rax before vmcall 2022-08-17 14:23:59 +02: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: Unconditionally use memslot 0 for vaddr allocations 2021-06-24 11:47:42 -04:00
guest_modes.c KVM: selftests: introduce P44V64 for z196 and EC12 2021-07-06 10:05:16 +02:00
io.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
kvm_util.c selftests: KVM: Fix non-x86 compiling 2021-12-29 12:28:37 +01:00
kvm_util_internal.h KVM: selftests: create alias mappings when using shared memory 2021-05-27 07:45:56 -04:00
perf_test_util.c KVM: selftests: Move vcpu_args_set into perf_test_util 2021-08-06 10:01:40 -04:00
rbtree.c KVM: selftests: Keep track of memslots more efficiently 2021-05-27 07:45:54 -04:00
sparsebit.c selftests: remove duplicate include 2021-05-07 00:26:33 -07:00
test_util.c x86: 2021-09-27 13:58:23 -07:00