]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: kvm: set rax before vmcall
authorAndrei Vagin <avagin@google.com>
Fri, 22 Jul 2022 23:02:40 +0000 (16:02 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 1 Aug 2022 12:43:05 +0000 (08:43 -0400)
commit68b91759521317be6d1b576adbc9fd194d3a1481
tree5c96eb87e1c6ab9801df94b16611f78f6a617aef
parent2302b23d36bde6594b5d8c0bfd71f6360140a655
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: 63f9b52f2a9a ("selftests: kvm: test enforcement of paravirtual cpuid features")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/x86_64/processor.c