public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] x86/tsc: Disable clocksource watchdog for TSC on recent UV
@ 2025-08-20 19:54 Dimitri Sivanich
  2025-09-11 13:21 ` Dimitri Sivanich
  0 siblings, 1 reply; 5+ messages in thread
From: Dimitri Sivanich @ 2025-08-20 19:54 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Jiri Wiesner, Thomas Gleixner, Jonathan Corbet, Steve Wahl,
	Justin Ernst, Kyle Meyer, Russ Anderson, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin

Disable clocksource watchdog checking on recent and future UV platforms
to avoid false positives.

Commits 'b50db7095fe0 ("x86/tsc: Disable clocksource watchdog for TSC on
qualified platforms")' and '233756a640be ("Extend watchdog check exemption
to 4-Sockets platform")' were introduced to avoid an issue where the TSC
is falsely declared unstable by exempting qualified platforms of up to
4-sockets from TSC clocksource watchdog checking.  Extend that exemption
to include recent and future UV platforms.

Signed-off-by: Dimitri Sivanich <sivanich@hpe.com>
---

Version 3:  Fixes a build error in the X86 32-bit build.

Version 2:  Fixes a build error that occurs when UV is not configured.

 arch/x86/include/asm/uv/uv.h     | 3 +++
 arch/x86/include/asm/uv/uv_hub.h | 2 ++
 arch/x86/kernel/tsc.c            | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h
index 648eb23fe7f0..f1aebdf85e68 100644
--- a/arch/x86/include/asm/uv/uv.h
+++ b/arch/x86/include/asm/uv/uv.h
@@ -38,6 +38,9 @@ static inline int is_uv_system(void)	{ return 0; }
 static inline int is_uv_hubbed(int uv)	{ return 0; }
 static inline void uv_cpu_init(void)	{ }
 static inline void uv_system_init(void)	{ }
+static inline int is_uvx_hub(void) { return 0; }
+static inline int is_uvy_hub(void) { return 0; }
+static inline int is_uv_hub(void) { return 0; }
 
 #endif	/* X86_UV */
 
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index ea877fd83114..6e085ce8fc02 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -246,6 +246,7 @@ static inline int is_uv5_hub(void) { return is_uv(UV5); }
  * then test if is UV4.
  */
 
+#ifdef CONFIG_X86_UV
 /* UVX class: UV2,3,4 */
 static inline int is_uvx_hub(void) { return is_uv(UVX); }
 
@@ -254,6 +255,7 @@ static inline int is_uvy_hub(void) { return is_uv(UVY); }
 
 /* Any UV Hubbed System */
 static inline int is_uv_hub(void) { return is_uv(UV_ANY); }
+#endif
 
 union uvh_apicid {
     unsigned long       v;
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 87e749106dda..a9f97d423ab0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -32,6 +32,7 @@
 #include <asm/msr.h>
 #include <asm/topology.h>
 #include <asm/uv/uv.h>
+#include <asm/uv/uv_hub.h>
 #include <asm/sev.h>
 
 unsigned int __read_mostly cpu_khz;	/* TSC clocks / usec, not used here */
@@ -1261,7 +1262,7 @@ static void __init check_system_tsc_reliable(void)
 	if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
 	    boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
 	    boot_cpu_has(X86_FEATURE_TSC_ADJUST) &&
-	    topology_max_packages() <= 4)
+	    (topology_max_packages() <= 4 || is_uvy_hub()))
 		tsc_disable_clocksource_watchdog();
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH v3] x86/tsc: Disable clocksource watchdog for TSC on recent UV
@ 2025-10-07 16:32 Dimitri Sivanich
  2025-10-07 16:48 ` Dave Hansen
  0 siblings, 1 reply; 5+ messages in thread
From: Dimitri Sivanich @ 2025-10-07 16:32 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Jiri Wiesner, Steve Wahl, Justin Ernst, Kyle Meyer, Russ Anderson,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Peter Zijlstra (Intel), Ilpo Järvinen,
	Marco Elver, Guilherme G. Piccoli, Nikunj A Dadhania,
	Xin Li (Intel), Dimitri Sivanich

Disable clocksource watchdog checking on recent and future UV platforms
to avoid false positives.

Commits 'b50db7095fe0 ("x86/tsc: Disable clocksource watchdog for TSC on
qualified platforms")' and '233756a640be ("Extend watchdog check exemption
to 4-Sockets platform")' were introduced to avoid an issue where the TSC
is falsely declared unstable by exempting qualified platforms of up to
4-sockets from TSC clocksource watchdog checking.  Extend that exemption
to include recent and future UV platforms.

Signed-off-by: Dimitri Sivanich <sivanich@hpe.com>
---

Version 3:  Fixes a build error in the X86 32-bit build.

Version 2:  Fixes a build error that occurs when UV is not configured.

 arch/x86/include/asm/uv/uv.h     | 3 +++
 arch/x86/include/asm/uv/uv_hub.h | 2 ++
 arch/x86/kernel/tsc.c            | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h
index 648eb23fe7f0..f1aebdf85e68 100644
--- a/arch/x86/include/asm/uv/uv.h
+++ b/arch/x86/include/asm/uv/uv.h
@@ -38,6 +38,9 @@ static inline int is_uv_system(void)	{ return 0; }
 static inline int is_uv_hubbed(int uv)	{ return 0; }
 static inline void uv_cpu_init(void)	{ }
 static inline void uv_system_init(void)	{ }
+static inline int is_uvx_hub(void) { return 0; }
+static inline int is_uvy_hub(void) { return 0; }
+static inline int is_uv_hub(void) { return 0; }
 
 #endif	/* X86_UV */
 
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index ea877fd83114..6e085ce8fc02 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -246,6 +246,7 @@ static inline int is_uv5_hub(void) { return is_uv(UV5); }
  * then test if is UV4.
  */
 
+#ifdef CONFIG_X86_UV
 /* UVX class: UV2,3,4 */
 static inline int is_uvx_hub(void) { return is_uv(UVX); }
 
@@ -254,6 +255,7 @@ static inline int is_uvy_hub(void) { return is_uv(UVY); }
 
 /* Any UV Hubbed System */
 static inline int is_uv_hub(void) { return is_uv(UV_ANY); }
+#endif
 
 union uvh_apicid {
     unsigned long       v;
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 87e749106dda..a9f97d423ab0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -32,6 +32,7 @@
 #include <asm/msr.h>
 #include <asm/topology.h>
 #include <asm/uv/uv.h>
+#include <asm/uv/uv_hub.h>
 #include <asm/sev.h>
 
 unsigned int __read_mostly cpu_khz;	/* TSC clocks / usec, not used here */
@@ -1261,7 +1262,7 @@ static void __init check_system_tsc_reliable(void)
 	if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
 	    boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
 	    boot_cpu_has(X86_FEATURE_TSC_ADJUST) &&
-	    topology_max_packages() <= 4)
+	    (topology_max_packages() <= 4 || is_uvy_hub()))
 		tsc_disable_clocksource_watchdog();
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-07 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 19:54 [PATCH v3] x86/tsc: Disable clocksource watchdog for TSC on recent UV Dimitri Sivanich
2025-09-11 13:21 ` Dimitri Sivanich
  -- strict thread matches above, loose matches on Subject: below --
2025-10-07 16:32 Dimitri Sivanich
2025-10-07 16:48 ` Dave Hansen
2025-10-07 17:42   ` Dimitri Sivanich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox