1
0
Fork 0
alistair23-linux/tools/testing/selftests/kvm/x86_64
Paolo Bonzini 204c91eff7 KVM: selftests: do not blindly clobber registers in guest asm
The guest_code of sync_regs_test is assuming that the compiler will not
touch %r11 outside the asm that increments it, which is a bit brittle.
Instead, we can increment a variable and use a dummy asm to ensure the
increment is not optimized away.  However, we also need to use a
callee-save register or the compiler will insert a save/restore around
the vmexit, breaking the whole idea behind the test.

(Yes, "if it ain't broken...", but I would like the test to be clean
before it is copied into the upcoming s390 selftests).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-05-24 21:27:10 +02:00
..
cr4_cpuid_sync_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00
evmcs_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00
hyperv_cpuid.c KVM: selftests: Remove duplicated TEST_ASSERT in hyperv_cpuid.c 2019-05-24 21:27:10 +02:00
kvm_create_max_vcpus.c tests: kvm: Add tests for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_CPU_ID 2019-05-08 14:02:12 +02:00
platform_info_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00
set_sregs_test.c kvm: selftests: move arch-specific files to arch-specific locations 2018-10-17 00:26:16 +02:00
smm_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00
state_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00
sync_regs_test.c KVM: selftests: do not blindly clobber registers in guest asm 2019-05-24 21:27:10 +02:00
vmx_close_while_nested_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00
vmx_set_nested_state_test.c kvm: selftests: avoid type punning 2019-05-24 21:27:05 +02:00
vmx_tsc_adjust_test.c KVM: selftests: Compile code with warnings enabled 2019-05-24 21:27:05 +02:00