1
0
Fork 0
alistair23-linux/tools/testing/selftests/kvm
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
..
include tests: kvm: Add tests for KVM_SET_NESTED_STATE 2019-05-08 14:12:09 +02:00
lib tests: kvm: Add tests for KVM_SET_NESTED_STATE 2019-05-08 14:12:09 +02:00
x86_64 KVM: selftests: Fix a condition in test_hv_cpuid() 2019-05-24 21:27:04 +02:00
.gitignore tests: kvm: Add tests for KVM_SET_NESTED_STATE 2019-05-08 14:12:09 +02:00
Makefile tests: kvm: Add tests for KVM_SET_NESTED_STATE 2019-05-08 14:12:09 +02:00
clear_dirty_log_test.c kvm: introduce manual dirty log reprotect 2018-12-14 12:34:19 +01:00
dirty_log_test.c * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00