Skip to contentSkip to conversation

x86/hyperv: Use correct macro in checking SynIC timer support

PATCH In review Kaya, Metin 2 participants 3 messages Jan 4, 2022 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86/hyperv: Use correct macro in checking SynIC timer support

This commit fixes 69d4bf751641520f5b2d8e3f160c63c8966fcd8b. stimer_supported() should use HV_X64_MSR_SYNTIMER_AVAILABLE instead of HV_X64_MSR_SYNIC_AVAILABLE.​

From 3e31f7d2b7bfc92ff710e3061b32301f96862b8b Mon Sep 17 00:00:00 2001
From: Metin Kaya <[email protected]>
Date: Wed, 22 Dec 2021 18:22:28 +0000
Subject: [kvm-unit-tests PATCH 1/2] x86/hyperv: Use correct macro in checking
SynIC timer support

This commit fixes 69d4bf751641520f5b2d8e3f160c63c8966fcd8b. stimer_supported() should use HV_X64_MSR_SYNTIMER_AVAILABLE instead of HV_X64_MSR_SYNIC_AVAILABLE.

---
 x86/hyperv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/hyperv.h +1 -1
index e135221..f2bb7b4 100644
@@ -190,7 +190,7 @@ static inline bool synic_supported(void)
 
 static inline bool stimer_supported(void)
 {
-    return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNIC_AVAILABLE;
+    return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNTIMER_AVAILABLE;
 }
 
 static inline bool hv_time_ref_counter_supported(void)
Signature · 1 line
2.32.0
Reviewed-by on v1 1/2
#1 lore raw
Quoted 11 lines · Metin

This commit fixes 69d4bf751641520f5b2d8e3f160c63c8966fcd8b. stimer_supported() should use HV_X64_MSR_SYNTIMER_AVAILABLE instead of HV_X64_MSR_SYNIC_AVAILABLE.​ From 3e31f7d2b7bfc92ff710e3061b32301f96862b8b Mon Sep 17 00:00:00 2001
From: Metin Kaya <[email protected]>
Date: Wed, 22 Dec 2021 18:22:28 +0000
Subject: [kvm-unit-tests PATCH 1/2] x86/hyperv: Use correct macro in checking
SynIC timer support

This commit fixes 69d4bf751641520f5b2d8e3f160c63c8966fcd8b. stimer_supported() should use HV_X64_MSR_SYNTIMER_AVAILABLE instead of HV_X64_MSR_SYNIC_AVAILABLE.

Fixes 69d4bf7 ("x86: Hyper-V SynIC timers test")
Quoted 10 lines
---
 x86/hyperv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/hyperv.h +0 -0
index e135221..f2bb7b4 100644

x86/hyperv.h static inline bool synic_supported(void) · line 194

Quoted 6 lines
x86/hyperv.h +1 -1
@@ -190,7 +190,7 @@ static inline bool synic_supported(void)
 
 static inline bool stimer_supported(void)
 {
-    return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNIC_AVAILABLE;
+    return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNTIMER_AVAILABLE;
 }

Unrelated to the change but I'd suggest renaming stimer_supported() to hv_stimer_supported() and synic_supported() to hv_synic_supported().

x86/hyperv.h static inline bool synic_supported(void) · line 196

Quoted 2 lines
x86/hyperv.h +0 -0
 static inline bool hv_time_ref_counter_supported(void)
Signature · 1 line
Vitaly
author Reviewed-by Vitaly Kuznetsov
#2 lore raw

Thanks, Vitaly. Will send another patch for it.
________________________________________
From: Vitaly Kuznetsov <[email protected]>
Sent: 04 January 2022 16:32
To: Kaya, Metin
Cc: [email protected]
Subject: RE: [EXTERNAL] [kvm-unit-tests PATCH 1/2] x86/hyperv: Use correct macro in checking SynIC timer support

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

Quoted 11 lines · Metin

This commit fixes 69d4bf751641520f5b2d8e3f160c63c8966fcd8b. stimer_supported() should use HV_X64_MSR_SYNTIMER_AVAILABLE instead of HV_X64_MSR_SYNIC_AVAILABLE.​ From 3e31f7d2b7bfc92ff710e3061b32301f96862b8b Mon Sep 17 00:00:00 2001
From: Metin Kaya <[email protected]>
Date: Wed, 22 Dec 2021 18:22:28 +0000
Subject: [kvm-unit-tests PATCH 1/2] x86/hyperv: Use correct macro in checking
SynIC timer support

This commit fixes 69d4bf751641520f5b2d8e3f160c63c8966fcd8b. stimer_supported() should use HV_X64_MSR_SYNTIMER_AVAILABLE instead of HV_X64_MSR_SYNIC_AVAILABLE.

Fixes 69d4bf7 ("x86: Hyper-V SynIC timers test")
Quoted 10 lines
---
 x86/hyperv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/hyperv.h +0 -0
index e135221..f2bb7b4 100644

x86/hyperv.h static inline bool synic_supported(void) · line 194

Quoted 6 lines
x86/hyperv.h +1 -1
@@ -190,7 +190,7 @@ static inline bool synic_supported(void)
 
 static inline bool stimer_supported(void)
 {
-    return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNIC_AVAILABLE;
+    return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNTIMER_AVAILABLE;
 }

Unrelated to the change but I'd suggest renaming stimer_supported() to hv_stimer_supported() and synic_supported() to hv_synic_supported().

x86/hyperv.h static inline bool synic_supported(void) · line 196

Quoted 2 lines
x86/hyperv.h +0 -0
 static inline bool hv_time_ref_counter_supported(void)

--
Vitaly