[PATCH] KVM: selftests: fix bit test in is_steal_time_supported()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The KVM_FEATURE_STEAL_TIME (5) define is the BIT() value so we need to
do shift for this to work correctly.

Fixes: 998016048221 ("KVM: selftests: Convert steal_time away from VCPU_ID")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 tools/testing/selftests/kvm/steal_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index d122f1e05cdd..b89f0cfa2dc3 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -62,7 +62,7 @@ static bool is_steal_time_supported(struct kvm_vcpu *vcpu)
 {
 	struct kvm_cpuid_entry2 *cpuid = kvm_get_supported_cpuid_entry(KVM_CPUID_FEATURES);
 
-	return cpuid && (cpuid->eax & KVM_FEATURE_STEAL_TIME);
+	return cpuid && (cpuid->eax & (1 << KVM_FEATURE_STEAL_TIME));
 }
 
 static void steal_time_init(struct kvm_vcpu *vcpu, uint32_t i)
-- 
2.35.1




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux