lkml.org 
[lkml]   [2017]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 4/5] x86/kernel: Provide a means to disable TSC ART
On systems where multiple chassis are reset asynchronously, and thus
the TSC counters are started asynchronously, the offset needed to
convert to TSC to ART would be different. Disable ART in that case
and rely on the TSC counters to supply the accurate time.

Signed-off-by: Mike Travis <mike.travis@hpe.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
---
v2: changed to use common "tsc_async_resets" flag.
v3: Patches merged against 4.14.0-rc4
---
arch/x86/kernel/tsc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- linux.orig/arch/x86/kernel/tsc.c
+++ linux/arch/x86/kernel/tsc.c
@@ -966,10 +966,14 @@ static void detect_art(void)
if (boot_cpu_data.cpuid_level < ART_CPUID_LEAF)
return;

- /* Don't enable ART in a VM, non-stop TSC and TSC_ADJUST required */
+ /*
+ * Don't enable ART in a VM, non-stop TSC and TSC_ADJUST required,
+ * and the TSC counter resets must not occur asynchronously.
+ */
if (boot_cpu_has(X86_FEATURE_HYPERVISOR) ||
!boot_cpu_has(X86_FEATURE_NONSTOP_TSC) ||
- !boot_cpu_has(X86_FEATURE_TSC_ADJUST))
+ !boot_cpu_has(X86_FEATURE_TSC_ADJUST) ||
+ tsc_async_resets)
return;

cpuid(ART_CPUID_LEAF, &art_to_tsc_denominator,
--

\
 
 \ /
  Last update: 2017-10-12 18:34    [W:0.330 / U:0.432 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site