linux-kernel-test/tools
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
..
accounting
arch tools headers kvm: Sync kvm headers with the kernel sources 2019-09-30 17:29:30 -03:00
bpf tools: bpf: Use !building_out_of_srctree to determine srctree 2019-09-30 10:53:34 +02:00
build
cgroup iocost_monitor: Report debt 2019-09-10 12:31:39 -06:00
debugging
firewire
firmware
gpio
hv - First round of vmbus hibernation support from Dexuan Cui. 2019-09-24 12:36:31 -07:00
iio
include tools headers kvm: Sync kvm headers with the kernel sources 2019-09-30 17:29:30 -03:00
io_uring
kvm/kvm_stat
laptop
leds
lib Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-19 17:09:11 -04:00
memory-model
nfsd
objtool KVM: x86: Check kvm_rebooting in kvm_spurious_fault() 2019-09-25 15:23:33 +02:00
pci
pcmcia
perf perf annotate: Don't return -1 for error when doing BPF disassembly 2019-09-30 17:30:06 -03:00
power platform-drivers-x86 for v5.4-2 2019-09-24 12:39:40 -07:00
scripts
spi
testing selftests: kvm: fix sync_regs_test with newer gccs 2019-10-22 13:31:18 +02:00
thermal/tmon
time
usb
virtio tools/virtio: xen stub 2019-10-13 09:38:27 -04:00
vm
wmi
Makefile