From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Fwd: [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC Date: Thu, 17 Dec 2009 20:15:33 -0800 Message-ID: <4B2B01E5.5060301@goop.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050705010008040307070704" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Dan Magenheimer , Xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------050705010008040307070704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit FYI. J --------------050705010008040307070704 Content-Type: message/rfc822; name="[PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="[PATCH] x86: Reenable TSC sync check at boot, even with NONS"; filename*1="TOP_TSC" Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on claw.goop.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=6.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.5 X-Original-To: jeremy@goop.org Delivered-To: jeremy@goop.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by claw.goop.org (Postfix) with ESMTP id 4B2C4A7D6 for ; Thu, 17 Dec 2009 12:27:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764912AbZLQU1Q (ORCPT ); Thu, 17 Dec 2009 15:27:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762723AbZLQU1H (ORCPT ); Thu, 17 Dec 2009 15:27:07 -0500 Received: from mga14.intel.com ([143.182.124.37]:2749 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765133AbZLQU1F (ORCPT ); Thu, 17 Dec 2009 15:27:05 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 17 Dec 2009 12:27:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,316,1257148800"; d="scan'208";a="224155614" Received: from linux-os.sc.intel.com ([172.25.110.8]) by azsmga001.ch.intel.com with ESMTP; 17 Dec 2009 12:27:03 -0800 Received: by linux-os.sc.intel.com (Postfix, from userid 47009) id C2C8F28006; Thu, 17 Dec 2009 12:27:02 -0800 (PST) Date: Thu, 17 Dec 2009 12:27:02 -0800 From: "Pallipadi, Venkatesh" To: Ingo Molnar , H Peter Anvin , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Suresh Siddha Subject: [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC Message-ID: <20091217202702.GA18015@linux-os.sc.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 83ce4009 did the following change If the TSC is constant and non-stop, also set it reliable. But, there seems to be few systems that will end up with TSC warp across sockets, depending on how the cpus come out of reset. Skipping TSC sync test on such systems may result in time inconsistency later. So, reenable TSC sync test even on constant and non-stop TSC systems. Set, sched_clock_stable to 1 by default and reset it in mark_tsc_unstable, if TSC sync fails. This change still gives perf benefit mentioned in 83ce4009 for systems where TSC is reliable. Signed-off-by: Venkatesh Pallipadi --- arch/x86/kernel/cpu/intel.c | 1 - arch/x86/kernel/tsc.c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 9c31e8b..879666f 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -70,7 +70,6 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) if (c->x86_power & (1 << 8)) { set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); - set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE); sched_clock_stable = 1; } diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index cd982f4..597683a 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -763,6 +763,7 @@ void mark_tsc_unstable(char *reason) { if (!tsc_unstable) { tsc_unstable = 1; + sched_clock_stable = 0; printk(KERN_INFO "Marking TSC unstable due to %s\n", reason); /* Change only the rating, when not registered */ if (clocksource_tsc.mult) -- 1.6.0.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ --------------050705010008040307070704 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050705010008040307070704--