Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1743320 > unrolled thread

[PATCH 4/5] x86/kernel: Provide a means to disable TSC ART

Started by<mike.travis@hpe.com>
First post2017-10-02 22:50 +0200
Last post2017-10-02 22:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/5] x86/kernel: Provide a means to disable TSC ART <mike.travis@hpe.com> - 2017-10-02 22:50 +0200

#1743320 — [PATCH 4/5] x86/kernel: Provide a means to disable TSC ART

From<mike.travis@hpe.com>
Date2017-10-02 22:50 +0200
Subject[PATCH 4/5] x86/kernel: Provide a means to disable TSC ART
Message-ID<uwfPk-ur-287@gated-at.bofh.it>
On systems where multiple chassis are reset asynchronously there is not a
constant ratio between the ART frequency and the TSC time that can be
provided by the boot cpu.  Provide a means to disable the ART capability
by arches that have this characteristic.

Signed-off-by: Mike Travis <mike.travis@hpe.com>
---
 arch/x86/include/asm/tsc.h |    1 +
 arch/x86/kernel/tsc.c      |   16 +++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

--- linux.orig/arch/x86/include/asm/tsc.h
+++ linux/arch/x86/include/asm/tsc.h
@@ -36,6 +36,7 @@ extern void mark_tsc_unstable(char *reas
 extern int unsynchronized_tsc(void);
 extern int check_tsc_unstable(void);
 extern void mark_tsc_multi_sync_resets(char *reason);
+extern void mark_tsc_art_disabled(char *reason);
 extern unsigned long native_calibrate_cpu(void);
 extern unsigned long native_calibrate_tsc(void);
 extern unsigned long long native_sched_clock_from_tsc(u64 tsc);
--- linux.orig/arch/x86/kernel/tsc.c
+++ linux/arch/x86/kernel/tsc.c
@@ -955,15 +955,25 @@ core_initcall(cpufreq_register_tsc_scali
 #define ART_CPUID_LEAF (0x15)
 #define ART_MIN_DENOMINATOR (1)
 
-
 /*
- * If ART is present detect the numerator:denominator to convert to TSC
+ * If ART is present detect the numerator:denominator to convert to TSC.
+ * The CPU ART capability can be disabled.
  */
+static bool tsc_art_disabled;
+
+void mark_tsc_art_disabled(char *reason)
+{
+	if (tsc_art_disabled)
+		return;
+	tsc_art_disabled = true;
+	pr_info("TSC: ART disabled due to %s\n", reason);
+}
+
 static void detect_art(void)
 {
 	unsigned int unused[2];
 
-	if (boot_cpu_data.cpuid_level < ART_CPUID_LEAF)
+	if (boot_cpu_data.cpuid_level < ART_CPUID_LEAF || tsc_art_disabled)
 		return;
 
 	/* Don't enable ART in a VM, non-stop TSC and TSC_ADJUST required */

-- 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web