linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* x86/MCE: Fix CPU microcode version output
@ 2018-07-31  7:43 Filippo Sironi
  0 siblings, 0 replies; 8+ messages in thread
From: Filippo Sironi @ 2018-07-31  7:43 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Prarit Bhargava, Luck, Tony, linux-kernel, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, linux-edac

> On 30. Jul 2018, at 18:16, Borislav Petkov <bp@alien8.de> wrote:
> 
> On Mon, Jul 30, 2018 at 11:23:18AM -0400, Prarit Bhargava wrote:
>> Filippo & Borislav, did the patch get committed to a -next tree?
> 
> No, I'm still waiting for it - looks like Filippo is busy.
> 
> Care to send one instead as suggested here?
> 
> https://lore.kernel.org/lkml/20180601121939.GA23298@nazgul.tnic/
> 
> -- 
> Regards/Gruss,
>    Boris.
> 
> ECO tip #101: Trim your mails when you reply.
> --

Sorry, I was out of office for a while.
I'll look into this today.

Filippo


Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-31  9:04 Borislav Petkov
  0 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2018-07-31  9:04 UTC (permalink / raw)
  To: Sironi, Filippo, Prarit Bhargava
  Cc: Luck, Tony, linux-kernel, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-edac

On Tue, Jul 31, 2018 at 07:43:46AM +0000, Sironi, Filippo wrote:
> Sorry, I was out of office for a while.
> I'll look into this today.

Prarit is doing a patch too - you might wanna save effort. I leave it up
to you guys to figure out who should do it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-30 16:16 Borislav Petkov
  0 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2018-07-30 16:16 UTC (permalink / raw)
  To: Prarit Bhargava
  Cc: Luck, Tony, linux-kernel, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-edac, Filippo Sironi

On Mon, Jul 30, 2018 at 11:23:18AM -0400, Prarit Bhargava wrote:
> Filippo & Borislav, did the patch get committed to a -next tree?

No, I'm still waiting for it - looks like Filippo is busy.

Care to send one instead as suggested here?

https://lore.kernel.org/lkml/20180601121939.GA23298@nazgul.tnic/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-30 15:23 Prarit Bhargava
  0 siblings, 0 replies; 8+ messages in thread
From: Prarit Bhargava @ 2018-07-30 15:23 UTC (permalink / raw)
  To: Borislav Petkov, Luck, Tony
  Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-edac, Filippo Sironi

On 07/03/2018 05:43 PM, Borislav Petkov wrote:
> On Tue, Jul 03, 2018 at 09:58:49AM -0700, Luck, Tony wrote:
>> On Tue, Jul 03, 2018 at 12:48:44PM -0400, Prarit Bhargava wrote:
>>> On systems where a runtime microcode update has occurred the
>>> microcode version is wrong because boot_cpu_data.microcode is
>>> not updated during runtime.
>>>
>>> Use the per-CPU microcode version in the MCE message.
>>
>> Other option would be to fix the microcode update code to make
>> sure that boot_cpu_data.microcode is right.
> 
> Yes, I already requested that:
> 
> https://lkml.kernel.org/r/1527852626-7258-1-git-send-email-sironi@amazon.de
> 
> Looks like Filippo has a patch already. CCed.

Filippo & Borislav, did the patch get committed to a -next tree?

P.

>
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-03 21:43 Borislav Petkov
  0 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2018-07-03 21:43 UTC (permalink / raw)
  To: Luck, Tony
  Cc: Prarit Bhargava, linux-kernel, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-edac, Filippo Sironi

On Tue, Jul 03, 2018 at 09:58:49AM -0700, Luck, Tony wrote:
> On Tue, Jul 03, 2018 at 12:48:44PM -0400, Prarit Bhargava wrote:
> > On systems where a runtime microcode update has occurred the
> > microcode version is wrong because boot_cpu_data.microcode is
> > not updated during runtime.
> > 
> > Use the per-CPU microcode version in the MCE message.
> 
> Other option would be to fix the microcode update code to make
> sure that boot_cpu_data.microcode is right.

Yes, I already requested that:

https://lkml.kernel.org/r/1527852626-7258-1-git-send-email-sironi@amazon.de

Looks like Filippo has a patch already. CCed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-03 20:08 Prarit Bhargava
  0 siblings, 0 replies; 8+ messages in thread
From: Prarit Bhargava @ 2018-07-03 20:08 UTC (permalink / raw)
  To: Luck, Tony
  Cc: linux-kernel, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-edac

On 07/03/2018 12:58 PM, Luck, Tony wrote:
> On Tue, Jul 03, 2018 at 12:48:44PM -0400, Prarit Bhargava wrote:
>> On systems where a runtime microcode update has occurred the
>> microcode version is wrong because boot_cpu_data.microcode is
>> not updated during runtime.
>>
>> Use the per-CPU microcode version in the MCE message.
> 
> Other option would be to fix the microcode update code to make
> sure that boot_cpu_data.microcode is right.

I thought about that too [1] but TBH I've always been a bit confused by
boot_cpu_data vs. cpu_data().  At one point I thought that boot_cpu_data is
valid only up to a specific point in boot and from that point on the cpu_data()
should be used but I'm no longer sure if that's correct.

If that is not correct when should boot_cpu_data be used vs cpu_data()?  Is
boot_cpu_data truly supposed to represent the general state of the boot cpu at
boot time?

Look at the same function mce_setup() that I modified in my patch.   There is
another reference to boot_cpu_data.x86_vendor (which obviously will never change
during runtime) that likely should be cpu_data() if my understanding above is
correct.

P.

[1] Since the kernel now uses a cpu rendezvous model to update the microcode it
would be trivial to set boot_cpu_data.microcode to the new value.

> 
> But if we go this route we should add:
> 
> Fixes: fa94d0c6e0f3 ("x86/MCE: Save microcode revision in machine check records")
> Cc: stable@vger.kernel.org
> 
> Can also get a:
> 
> Reviewed-by: Tony Luck <tony.luck@intel.com>
> 
> -Tony Luck
>
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-03 16:58 Luck, Tony
  0 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2018-07-03 16:58 UTC (permalink / raw)
  To: Prarit Bhargava
  Cc: linux-kernel, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-edac

On Tue, Jul 03, 2018 at 12:48:44PM -0400, Prarit Bhargava wrote:
> On systems where a runtime microcode update has occurred the
> microcode version is wrong because boot_cpu_data.microcode is
> not updated during runtime.
> 
> Use the per-CPU microcode version in the MCE message.

Other option would be to fix the microcode update code to make
sure that boot_cpu_data.microcode is right.

But if we go this route we should add:

Fixes: fa94d0c6e0f3 ("x86/MCE: Save microcode revision in machine check records")
Cc: stable@vger.kernel.org

Can also get a:

Reviewed-by: Tony Luck <tony.luck@intel.com>

-Tony Luck
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* x86/MCE: Fix CPU microcode version output
@ 2018-07-03 16:48 Prarit Bhargava
  0 siblings, 0 replies; 8+ messages in thread
From: Prarit Bhargava @ 2018-07-03 16:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, Tony Luck, Borislav Petkov, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, linux-edac

On systems where a runtime microcode update has occurred the
microcode version is wrong because boot_cpu_data.microcode is
not updated during runtime.

Use the per-CPU microcode version in the MCE message.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-edac@vger.kernel.org
---
 arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index c102ad51025e..64fee27433e9 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -134,7 +134,7 @@ void mce_setup(struct mce *m)
 	if (this_cpu_has(X86_FEATURE_INTEL_PPIN))
 		rdmsrl(MSR_PPIN, m->ppin);
 
-	m->microcode = boot_cpu_data.microcode;
+	m->microcode = cpu_data(m->extcpu).microcode;
 }
 
 DEFINE_PER_CPU(struct mce, injectm);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-31  9:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31  7:43 x86/MCE: Fix CPU microcode version output Filippo Sironi
  -- strict thread matches above, loose matches on Subject: below --
2018-07-31  9:04 Borislav Petkov
2018-07-30 16:16 Borislav Petkov
2018-07-30 15:23 Prarit Bhargava
2018-07-03 21:43 Borislav Petkov
2018-07-03 20:08 Prarit Bhargava
2018-07-03 16:58 Luck, Tony
2018-07-03 16:48 Prarit Bhargava

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).