1
0
Fork 0
alistair23-linux/tools/testing/selftests/kvm/x86_64
Dan Carpenter be7fcf1d17 KVM: selftests: Fix a condition in test_hv_cpuid()
The code is trying to check that all the padding is zeroed out and it
does this:

    entry->padding[0] == entry->padding[1] == entry->padding[2] == 0

Assume everything is zeroed correctly, then the first comparison is
true, the next comparison is false and false is equal to zero so the
overall condition is true.  This bug doesn't affect run time very
badly, but the code should instead just check that all three paddings
are zero individually.

Also the error message was copy and pasted from an earlier error and it
wasn't correct.

Fixes: 7edcb73433 ("KVM: selftests: Add hyperv_cpuid test")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-05-24 21:27:04 +02:00
..
cr4_cpuid_sync_test.c KVM: selftests: assert on exit reason in CR4/cpuid sync test 2019-03-28 17:29:05 +01:00
evmcs_test.c selftests: kvm/evmcs_test: complete I/O before migrating guest state 2019-04-16 15:37:39 +02:00
hyperv_cpuid.c KVM: selftests: Fix a condition in test_hv_cpuid() 2019-05-24 21:27:04 +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: move arch-specific files to arch-specific locations 2018-10-17 00:26:16 +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 selftests: kvm: add a selftest for SMM 2019-04-16 15:38:06 +02:00
state_test.c selftests: kvm/evmcs_test: complete I/O before migrating guest state 2019-04-16 15:37:39 +02:00
sync_regs_test.c kvm: selftests: move arch-specific files to arch-specific locations 2018-10-17 00:26:16 +02:00
vmx_close_while_nested_test.c selftests: kvm: add selftest for releasing VM file descriptor while in L2 2019-02-12 13:12:12 +01:00
vmx_set_nested_state_test.c tests: kvm: Add tests for KVM_SET_NESTED_STATE 2019-05-08 14:12:09 +02:00
vmx_tsc_adjust_test.c KVM: selftests: state_test: test bare VMXON migration 2018-10-17 00:30:18 +02:00