mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <mike.travis@hpe.com>
To: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Bin Gao <bin.gao@linux.intel.com>,
	Prarit Bhargava <prarit@redhat.com>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Andrew Banman <andrew.banman@hpe.com>,
	Russ Anderson <russ.anderson@hpe.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: [PATCH 1/4] x86/kernel: Remove requirement that TSC ADJUST must be 0 on socket 0
Date: Thu, 28 Sep 2017 13:03:40 -0500	[thread overview]
Message-ID: <20170928180339.162913870@stormcage.americas.sgi.com> (raw)
In-Reply-To: <20170928180339.010141096@stormcage.americas.sgi.com>

[-- Attachment #1: add-base-nonzero --]
[-- Type: text/plain, Size: 2320 bytes --]

Remove the requirement that the TSC ADJUST value for socket 0 must
be zero.  This is the case when there are multiple chassis are being
reset asynchronously with each other and socket 0 may not necessarily
be starting first.

Signed-off-by: Mike Travis <mike.travis@hpe.com>
Reviewed-by: Dimitri Sivanich <dimitri.sivanich@hpe.com>
Reviewed-by: Russ Anderson <russ.anderson@hpe.com>
---
 arch/x86/kernel/tsc_sync.c |   29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)

--- linux.orig/arch/x86/kernel/tsc_sync.c
+++ linux/arch/x86/kernel/tsc_sync.c
@@ -58,29 +58,6 @@ void tsc_verify_tsc_adjust(bool resume)
 	}
 }
 
-static void tsc_sanitize_first_cpu(struct tsc_adjust *cur, s64 bootval,
-				   unsigned int cpu, bool bootcpu)
-{
-	/*
-	 * First online CPU in a package stores the boot value in the
-	 * adjustment value. This value might change later via the sync
-	 * mechanism. If that fails we still can yell about boot values not
-	 * being consistent.
-	 *
-	 * On the boot cpu we just force set the ADJUST value to 0 if it's
-	 * non zero. We don't do that on non boot cpus because physical
-	 * hotplug should have set the ADJUST register to a value > 0 so
-	 * the TSC is in sync with the already running cpus.
-	 */
-	if (bootcpu && bootval != 0) {
-		pr_warn(FW_BUG "TSC ADJUST: CPU%u: %lld force to 0\n", cpu,
-			bootval);
-		wrmsrl(MSR_IA32_TSC_ADJUST, 0);
-		bootval = 0;
-	}
-	cur->adjusted = bootval;
-}
-
 #ifndef CONFIG_SMP
 bool __init tsc_store_and_check_tsc_adjust(bool bootcpu)
 {
@@ -92,8 +69,8 @@ bool __init tsc_store_and_check_tsc_adju
 
 	rdmsrl(MSR_IA32_TSC_ADJUST, bootval);
 	cur->bootval = bootval;
+	cur->adjusted = bootval;
 	cur->nextcheck = jiffies + HZ;
-	tsc_sanitize_first_cpu(cur, bootval, smp_processor_id(), bootcpu);
 	return false;
 }
 
@@ -114,6 +91,7 @@ bool tsc_store_and_check_tsc_adjust(bool
 
 	rdmsrl(MSR_IA32_TSC_ADJUST, bootval);
 	cur->bootval = bootval;
+	cur->adjusted = bootval;
 	cur->nextcheck = jiffies + HZ;
 	cur->warned = false;
 
@@ -128,8 +106,7 @@ bool tsc_store_and_check_tsc_adjust(bool
 	refcpu = mask ? cpumask_any_but(mask, cpu) : nr_cpu_ids;
 
 	if (refcpu >= nr_cpu_ids) {
-		tsc_sanitize_first_cpu(cur, bootval, smp_processor_id(),
-				       bootcpu);
+		cur->adjusted = bootval;
 		return false;
 	}
 

-- 

  reply	other threads:[~2017-09-28 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 18:03 [PATCH 0/4] x86/platform/UV: Update TSC support mike.travis
2017-09-28 18:03 ` mike.travis [this message]
2017-09-28 18:03 ` [PATCH 2/4] x86/kernel: Skip TSC test and error messages if already unstable mike.travis
2017-09-28 18:03 ` [PATCH 3/4] x86/kernel: Drastically reduce the number of firmware bug warnings mike.travis
2017-09-28 18:03 ` [PATCH 4/4] x86/platform/UV: Add check of TSC state set by UV BIOS mike.travis
2017-09-29  8:46 ` [PATCH 0/4] x86/platform/UV: Update TSC support Peter Zijlstra
2017-09-29 15:19   ` Mike Travis
2017-09-29 16:23     ` Peter Zijlstra
2017-09-29 17:39       ` Mike Travis
2017-09-29 18:41         ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170928180339.162913870@stormcage.americas.sgi.com \
    --to=mike.travis@hpe.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andrew.banman@hpe.com \
    --cc=bin.gao@linux.intel.com \
    --cc=dimitri.sivanich@hpe.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=prarit@redhat.com \
    --cc=russ.anderson@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®