linux-kernel-test/tools/testing/selftests/kvm
Vitaly Kuznetsov ef40598098 selftests: kvm: fix sync_regs_test with newer gccs
Commit 204c91eff7 ("KVM: selftests: do not blindly clobber registers in
 guest asm") was intended to make test more gcc-proof, however, the result
is exactly the opposite: on newer gccs (e.g. 8.2.1) the test breaks with

==== Test Assertion Failure ====
  x86_64/sync_regs_test.c:168: run->s.regs.regs.rbx == 0xBAD1DEA + 1
  pid=14170 tid=14170 - Invalid argument
     1	0x00000000004015b3: main at sync_regs_test.c:166 (discriminator 6)
     2	0x00007f413fb66412: ?? ??:0
     3	0x000000000040191d: _start at ??:?
  rbx sync regs value incorrect 0x1.

Apparently, compile is still free to play games with registers even
when they have variables attached.

Re-write guest code with 'asm volatile' by embedding ucall there and
making sure rbx is preserved.

Fixes: 204c91eff7 ("KVM: selftests: do not blindly clobber registers in guest asm")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-10-22 13:31:18 +02:00
..
include selftests: kvm: consolidate VMX support checks 2019-10-22 13:31:16 +02:00
lib selftests: kvm: consolidate VMX support checks 2019-10-22 13:31:16 +02:00
s390x KVM: selftests: Test invalid bits in kvm_valid_regs and kvm_dirty_regs on s390x 2019-09-04 15:38:05 +02:00
x86_64 selftests: kvm: fix sync_regs_test with newer gccs 2019-10-22 13:31:18 +02:00
.gitignore selftests: kvm: synchronize .gitignore to Makefile 2019-10-22 13:31:13 +02:00
clear_dirty_log_test.c kvm: introduce manual dirty log reprotect 2018-12-14 12:34:19 +01:00
config selftests: kvm: Adding config fragments 2019-08-09 16:52:38 +02:00
dirty_log_test.c KVM: selftests: Remove duplicate guest mode handling 2019-09-24 13:37:24 +02:00
kvm_create_max_vcpus.c KVM: s390: add kselftests 2019-07-15 13:28:58 +02:00
Makefile selftests: kvm: Fix libkvm build error 2019-10-03 12:07:58 +02:00