linux/tools/testing/selftests/kvm/lib
Ricardo Koller 47bc726fe8 KVM: selftests: Add operand to vmsave/vmload/vmrun in svm.c
Building the KVM selftests with LLVM's integrated assembler fails with:

  $ CFLAGS=-fintegrated-as make -C tools/testing/selftests/kvm CC=clang
  lib/x86_64/svm.c:77:16: error: too few operands for instruction
          asm volatile ("vmsave\n\t" : : "a" (vmcb_gpa) : "memory");
                        ^
  <inline asm>:1:2: note: instantiated into assembly here
          vmsave
          ^
  lib/x86_64/svm.c:134:3: error: too few operands for instruction
                  "vmload\n\t"
                  ^
  <inline asm>:1:2: note: instantiated into assembly here
          vmload
          ^
This is because LLVM IAS does not currently support calling vmsave,
vmload, or vmload without an explicit %rax operand.

Add an explicit operand to vmsave, vmload, and vmrum in svm.c. Fixing
this was suggested by Sean Christopherson.

Tested: building without this error in clang 11. The following patch
(not queued yet) needs to be applied to solve the other remaining error:
"selftests: kvm: remove reassignment of non-absolute variables".

Suggested-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/kvm/X+Df2oQczVBmwEzi@google.com/
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Message-Id: <20210210031719.769837-1-ricarkol@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-11 08:02:08 -05:00
..
aarch64 KVM: selftests: Make vm_create_default common 2020-11-15 09:49:19 -05:00
s390x KVM: s390: Features and Test for 5.11 2020-12-12 03:58:31 -05:00
x86_64 KVM: selftests: Add operand to vmsave/vmload/vmrun in svm.c 2021-02-11 08:02:08 -05:00
assert.c KVM: selftests: Use consistent message for test skipping 2020-03-16 17:59:05 +01:00
elf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
guest_modes.c KVM: selftests: Factor out guest mode code 2021-01-07 18:07:29 -05:00
io.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
kvm_util_internal.h KVM: selftests: Add dirty ring buffer test 2020-11-15 09:49:17 -05:00
kvm_util.c KVM: x86/xen: intercept xen hypercalls if enabled 2021-02-04 14:18:45 +00:00
perf_test_util.c KVM: selftests: Add backing src parameter to dirty_log_perf_test 2021-02-04 05:27:19 -05:00
sparsebit.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
test_util.c KVM: selftests: Add backing src parameter to dirty_log_perf_test 2021-02-04 05:27:19 -05:00