mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, eranian@google.com,
	peterz@infradead.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 4/4] x86: Detect model/family mismatches for common microcode revision
Date: Wed, 13 Jun 2012 13:20:42 -0700	[thread overview]
Message-ID: <1339618842-26636-5-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1339618842-26636-1-git-send-email-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

When the model/family don't match force the common microcode to zero.
On such configurations there is no sane way to check for microcode
revisions, so don't even try.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/common.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index cfc50e0..9642929 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1183,12 +1183,26 @@ __cpuinit void boot_update_min_microcode(struct cpuinfo_x86 *c)
 	if (!boot_min_microcode) {
 		boot_min_microcode = c->microcode;
 		boot_cpu_data.microcode = c->microcode;
-	} else if (c->microcode < boot_min_microcode) {
-		pr_warn("CPU %d has lower microcode revision %x at boot than boot CPU (%x)\n",
-			smp_processor_id(), 
-			c->microcode,
-			boot_min_microcode);
-		boot_cpu_data.microcode = c->microcode;
+	} else {
+		if (c->microcode < boot_min_microcode) {
+			pr_warn("CPU %d has lower microcode revision %x at boot than boot CPU (%x)\n",
+				smp_processor_id(), 
+				c->microcode,
+				boot_min_microcode);
+			boot_cpu_data.microcode = c->microcode;
+		}
+		/* Assume steppings have common microcode version numbers */
+		if (c->x86 != boot_cpu_data.x86 || 
+		    c->x86_model != boot_cpu_data.x86_model) {
+			pr_warn("CPU %d model mismatch to boot CPU: %d,%d vs %d,%d\n",
+				smp_processor_id(),
+				boot_cpu_data.x86,
+				boot_cpu_data.x86_model,
+				c->x86,
+				c->x86_model);
+			/* Disable any common microcode checks. */
+			boot_cpu_data.microcode = 0;
+		}
 	}
 }
 
-- 
1.7.7.6


  parent reply	other threads:[~2012-06-13 20:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 20:20 Updated microcode tracking and PEBS workaround patchkit Andi Kleen
2012-06-13 20:20 ` [PATCH 1/4] x86: Do microcode updates at CPU_STARTING, not CPU_ONLINE Andi Kleen
2012-06-14 11:00   ` Borislav Petkov
2012-06-14 13:54     ` Henrique de Moraes Holschuh
2012-06-13 20:20 ` [PATCH 2/4] x86: Track minimum microcode revision globally v2 Andi Kleen
2012-06-13 21:34   ` Peter Zijlstra
2012-06-13 21:39     ` Andi Kleen
2012-06-14  8:56       ` Ingo Molnar
2012-06-13 21:35   ` Peter Zijlstra
2012-06-13 21:51     ` Andi Kleen
2012-06-14  9:10   ` Borislav Petkov
2012-06-14 13:36     ` Andi Kleen
2012-06-14 12:20   ` Borislav Petkov
2012-06-14 12:37   ` Borislav Petkov
2012-06-13 20:20 ` [PATCH 3/4] perf, x86: check ucode before disabling PEBS on SandyBridge v3 Andi Kleen
2012-06-13 21:30   ` Peter Zijlstra
2012-06-13 21:34     ` Andi Kleen
2012-06-13 21:36       ` Peter Zijlstra
2012-06-13 22:34         ` Andi Kleen
2012-06-13 20:20 ` Andi Kleen [this message]
2012-06-14 18:02   ` [PATCH 4/4] x86: Detect model/family mismatches for common microcode revision Borislav Petkov

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=1339618842-26636-5-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --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®