public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Daniel Drake <dsd@laptop.org>
Cc: Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Geode LX boot fails after x86 microcode revision change
Date: Wed, 9 Nov 2011 18:34:12 +0100	[thread overview]
Message-ID: <20111109173412.GE14181@aftab> (raw)
In-Reply-To: <CAMLZHHRc+yNr=6SB7Z1t_hyL+e8a0T-BokyQ+wVUPw-vhd3rQA@mail.gmail.com>

On Tue, Nov 08, 2011 at 04:59:05PM -0600, Daniel Drake wrote:
> On Tue, Nov 8, 2011 at 4:37 PM, Borislav Petkov <bp@alien8.de> wrote:
> > Yep, just send me /proc/cpuinfo from a working kernel.

Daniel, would you please test? It should work though :-)

Thanks.

--
>From daa04c94628d5686404bd6985d4545f12c2fa4fd Mon Sep 17 00:00:00 2001
From: Borislav Petkov <borislav.petkov@amd.com>
Date: Wed, 9 Nov 2011 18:08:40 +0100
Subject: [PATCH] x86, microcode, AMD: Restrict microcode reporting

bcb80e53877c ("x86, microcode, AMD: Add microcode revision to
/proc/cpuinfo") added support for dumping microcode patch level in
/proc/cpuinfo on AMD. Although we were very cautious and did rdmsr_safe
on the microcode patch level MSR, this broke booting on Geode LX because
this CPU doesn't have that MSR and at the time we do the read, exception
tables which are used by rdmsr_safe are not yet initialized, leading to
a boot hang.

This is the simple fix which enables the microcode line in /proc/cpuinfo
for K8 and newer (it is not that interesting for older boxes anyway
:-)).

Reported-and-bisected-by: Daniel Drake <dsd@laptop.org>
Link: http://lkml.kernel.org/r/CAMLZHHTSuHZoPbm_YfB8G05JA+xKCE4+Jmj4NW8mnZUHogQSBA@mail.gmail.com
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
 arch/x86/kernel/cpu/amd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index c7e46cb..a72d183 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -474,7 +474,8 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
 	}
 #endif
 
-	rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
+	if (c->x86 >= 0xf)
+		rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
 }
 
 static void __cpuinit init_amd(struct cpuinfo_x86 *c)
-- 
1.7.8.rc0


-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2011-11-09 17:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 19:59 Geode LX boot fails after x86 microcode revision change Daniel Drake
2011-11-08 20:31 ` Borislav Petkov
2011-11-08 22:01   ` H. Peter Anvin
2011-11-08 22:13     ` Petkov, Borislav
2011-11-08 22:17       ` Daniel Drake
2011-11-08 22:37         ` Borislav Petkov
2011-11-08 22:59           ` Daniel Drake
2011-11-09 17:34             ` Borislav Petkov [this message]
2011-11-10 13:05               ` Srivatsa S. Bhat
2011-11-10 13:28                 ` Borislav Petkov
2011-11-10 13:37                   ` Srivatsa S. Bhat
2011-11-10 13:34               ` Srivatsa S. Bhat
2011-11-11 18:40               ` Daniel Drake
2011-11-12 13:50                 ` Borislav Petkov
2011-11-08 22:19       ` H. Peter Anvin
2011-11-08 22:40         ` Borislav Petkov
2011-11-22 13:00         ` Borislav Petkov
2011-11-22 18:54           ` H. Peter Anvin

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=20111109173412.GE14181@aftab \
    --to=bp@amd64.org \
    --cc=bp@alien8.de \
    --cc=dsd@laptop.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.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