[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yvyfi9XC8bu0cOG+@gmail.com>
Date: Wed, 17 Aug 2022 09:58:03 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Ashok Raj <ashok.raj@...el.com>
Cc: Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Tony Luck <tony.luck@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
LKML Mailing List <linux-kernel@...r.kernel.org>,
X86-kernel <x86@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Tom Lendacky <thomas.lendacky@....com>,
Jacon Jun Pan <jacob.jun.pan@...el.com>
Subject: Re: [PATCH v3 3/5] x86/microcode: Avoid any chance of MCE's during
microcode update
* Ingo Molnar <mingo@...nel.org> wrote:
> > +void mce_set_mcip(void)
> > +{
> > + mce_wrmsrl(MSR_IA32_MCG_STATUS, 0x1);
> > +}
> > +
> > +void mce_clear_mcip(void)
> > +{
> > + mce_wrmsrl(MSR_IA32_MCG_STATUS, 0x0);
> > +}
>
> Instead of naming new APIs after how they are doing stuff, please name them
> after *what* they are doing at the highest level: they disable/enable MCEs.
>
> Ie. I'd suggest something like:
>
> mce_disable()
> mce_enable()
>
> I'd also suggest to at minimum add a WARN_ON_ONCE() if MSR_IA32_MCG_STATUS
> is already 1 when we disable it - because whoever wanted it disabled will
> now be surprised by us enabling them again.
Also, Boris tells me that writing 0x0 to MSR_IA32_MCG_STATUS apparently
shuts the platform down - which is not ideal...
Thanks,
Ingo
Powered by blists - more mailing lists