linux/tools/testing
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
..
fault-injection
ktest Kbuild updates for v5.11 2020-12-22 14:02:39 -08:00
kunit kunit: tool: Force the use of the 'tty' console for UML 2021-01-04 09:18:38 -07:00
nvdimm x86, libnvdimm/test: Remove COPY_MC_TEST 2020-10-26 18:08:35 +01:00
radix-tree ida: Free allocated bitmap in error path 2020-10-07 09:11:33 -04:00
scatterlist RDMA 5.11 pull request 2020-12-16 13:42:26 -08:00
selftests KVM: selftests: Add operand to vmsave/vmload/vmrun in svm.c 2021-02-11 08:02:08 -05:00
vsock SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00