linux-xiaomi-chiron/tools/testing/selftests/kvm/x86_64
Yang Weijiang 18391e5e9c selftests: kvm: Fix assert failure in single-step test
This is a follow-up patch to fix an issue left in commit:
98b0bf0273
selftests: kvm: Use a shorter encoding to clear RAX

With the change in the commit, we also need to modify "xor" instruction
length from 3 to 2 in array ss_size accordingly to pass below check:

for (i = 0; i < (sizeof(ss_size) / sizeof(ss_size[0])); i++) {
        target_rip += ss_size[i];
        CLEAR_DEBUG();
        debug.control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP;
        debug.arch.debugreg[7] = 0x00000400;
        APPLY_DEBUG();
        vcpu_run(vm, VCPU_ID);
        TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG &&
                    run->debug.arch.exception == DB_VECTOR &&
                    run->debug.arch.pc == target_rip &&
                    run->debug.arch.dr6 == target_dr6,
                    "SINGLE_STEP[%d]: exit %d exception %d rip 0x%llx "
                    "(should be 0x%llx) dr6 0x%llx (should be 0x%llx)",
                    i, run->exit_reason, run->debug.arch.exception,
                    run->debug.arch.pc, target_rip, run->debug.arch.dr6,
                    target_dr6);
}

Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
Message-Id: <20200826015524.13251-1-weijiang.yang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-23 10:23:56 -04:00
..
cr4_cpuid_sync_test.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
debug_regs.c selftests: kvm: Fix assert failure in single-step test 2020-09-23 10:23:56 -04:00
evmcs_test.c KVM: selftests: Don't probe KVM_CAP_HYPERV_ENLIGHTENED_VMCS when nested VMX is unsupported 2020-06-11 12:35:18 -04:00
hyperv_cpuid.c KVM: selftests: Don't probe KVM_CAP_HYPERV_ENLIGHTENED_VMCS when nested VMX is unsupported 2020-06-11 12:35:18 -04:00
mmio_warning_test.c KVM: selftests: Use consistent message for test skipping 2020-03-16 17:59:05 +01:00
platform_info_test.c KVM: selftests: Use consistent message for test skipping 2020-03-16 17:59:05 +01:00
set_sregs_test.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
smm_test.c KVM: selftests: fix sync_with_host() in smm_test 2020-06-11 12:35:19 -04:00
state_test.c KVM: selftests: do not substitute SVM/VMX check with KVM_CAP_NESTED_STATE check 2020-06-11 12:35:17 -04:00
svm_vmcall_test.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
sync_regs_test.c KVM: selftests: Use consistent message for test skipping 2020-03-16 17:59:05 +01:00
vmx_close_while_nested_test.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
vmx_dirty_log_test.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
vmx_preemption_timer_test.c KVM: selftests: fix vmx_preemption_timer_test build with GCC10 2020-06-08 07:59:43 -04:00
vmx_set_nested_state_test.c KVM: nVMX: check for invalid hdr.vmx.flags 2020-07-27 09:04:50 -04:00
vmx_tsc_adjust_test.c selftests: kvm: Uses TEST_FAIL in tests/utilities 2020-03-16 17:59:11 +01:00
xss_msr_test.c KVM: selftests: Use consistent message for test skipping 2020-03-16 17:59:05 +01:00