From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751691AbdJEQrX (ORCPT ); Thu, 5 Oct 2017 12:47:23 -0400 Received: from relay1.sgi.com ([192.48.180.66]:40238 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbdJEQrS (ORCPT ); Thu, 5 Oct 2017 12:47:18 -0400 Message-Id: <20171005164716.745601733@stormcage.americas.sgi.com> References: <20171005164716.233817374@stormcage.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Thu, 05 Oct 2017 11:47:20 -0500 From: To: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Bin Gao , Prarit Bhargava , Dimitri Sivanich , Andrew Banman , Russ Anderson , linux-kernel@vger.kernel.org, x86@kernel.org Subject: [PATCH 4/5] x86/kernel: Provide a means to disable TSC ART Content-Disposition: inline; filename=disable-detect_art Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Thomas Gleixner --- v2: changed to use common "tsc_async_resets" flag. --- 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, --