@@ -63,4 +63,10 @@ void stop_nmi(void);
void restart_nmi(void);
void local_touch_nmi(void);
+#ifdef CONFIG_HARDLOCKUP_DETECTOR
+extern void hardlockup_detector_mark_hpet_hld_unavailable(void);
+#else
+static inline void hardlockup_detector_mark_hpet_hld_unavailable(void) {}
+#endif
+
#endif /* _ASM_X86_NMI_H */
@@ -1191,6 +1191,9 @@ void mark_tsc_unstable(char *reason)
clocksource_mark_unstable(&clocksource_tsc_early);
clocksource_mark_unstable(&clocksource_tsc);
+
+ /* The HPET hardlockup detector depends on a stable TSC. */
+ hardlockup_detector_mark_hpet_hld_unavailable();
}
EXPORT_SYMBOL_GPL(mark_tsc_unstable);
@@ -6,6 +6,8 @@
* Copyright (C) Intel Corporation 2023
*/
+#define pr_fmt(fmt) "watchdog: " fmt
+
#include <linux/nmi.h>
#include <asm/hpet.h>
@@ -84,3 +86,12 @@ void watchdog_nmi_start(void)
if (detector_type == X86_HARDLOCKUP_DETECTOR_HPET)
hardlockup_detector_hpet_start();
}
+
+void hardlockup_detector_mark_hpet_hld_unavailable(void)
+{
+ if (detector_type != X86_HARDLOCKUP_DETECTOR_HPET)
+ return;
+
+ pr_warn("TSC is unstable. Stopping the HPET NMI watchdog.");
+ hardlockup_detector_mark_unavailable();
+}