All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bryan O'Donoghue" <bryan.odonoghue.lkml@nexus-software.ie>
To: Borislav Petkov <bp@alien8.de>
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, x86@kernel.org,
	fenghua.yu@intel.com
Subject: Re: [PATCH] x86: Add check for P5 to microcode_intel_early
Date: Fri, 19 Apr 2013 21:35:18 +0100	[thread overview]
Message-ID: <5171AA86.604@nexus-software.ie> (raw)
In-Reply-To: <20130419191128.GA21991@pd.tnic>

On 19/04/13 20:11, Borislav Petkov wrote:
> On Fri, Apr 19, 2013 at 06:23:03PM +0100, Bryan O'Donoghue wrote:
>> Architectural MSRs associated with microcode are for P6 or higher.
>> Add a check to early microcode to detect<  P6.
>>
>> Without a check for<  P6 - we end up reading from unimplemented MSRs
>> on Pentium.
>
> Is this something you're actually seeing on some box or just found by
> staring at the code?

We actually see this on a P5 alright.
The code path is reachable, no question.

> In any case, the family checks should go into the ucode driver entry
> points in arch/x86/kernel/microcode_core_early.c. AFAICT, x86_vendor()
> is a good candidate to be taught to read out the family too and return
> X86_VENDOR_UNKNOWN if<  P6. Or something to that effect.

Hmm

Just returning X86_VENDOR_UNKNOWN - won't fix the bug though - after all 
MSR_IA32_UCODE_REV is also x86_family() >= 6

x86 = get_x86_family(csig.sig);
x86_model = get_x86_model(csig.sig);

if (x86 < 6)
	return UCODE_ERROR;

if ((x86_model >= 5) || (x86 > 6)) {
	/* get processor flags from MSR 0x17 */
	native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
	csig.pf = 1 << ((val[1] >> 18) & 7);
}

native_wrmsr(MSR_IA32_UCODE_REV, 0, 0);

/* As documented in the SDM: Do a CPUID 1 here */
sync_core();

/* get the current revision from MSR 0x8B */
native_rdmsr(MSR_IA32_UCODE_REV, val[0], val[1]);

Peter - what's your take ?


  reply	other threads:[~2013-04-19 20:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 17:23 [PATCH] x86: Add check for P5 to microcode_intel_early Bryan O'Donoghue
2013-04-19 19:11 ` Borislav Petkov
2013-04-19 20:35   ` Bryan O'Donoghue [this message]
2013-04-19 20:55     ` Borislav Petkov
2013-04-19 21:25       ` Borislav Petkov
2013-04-19 21:44         ` Bryan O'Donoghue
2013-04-19 22:02           ` H. Peter Anvin
2013-04-19 23:13           ` H. Peter Anvin
2013-04-20  9:24             ` Bryan O'Donoghue
2013-04-20 15:52               ` H. Peter Anvin
2013-04-20  0:20 ` [tip:x86/urgent] x86, microcode: Verify the family before dispatching microcode patching tip-bot for H. Peter Anvin
2013-04-20 16:21   ` Bryan O'Donoghue

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=5171AA86.604@nexus-software.ie \
    --to=bryan.odonoghue.lkml@nexus-software.ie \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.