[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250630125830.GB5995@yaz-khff2.amd.com>
Date: Mon, 30 Jun 2025 08:58:30 -0400
From: Yazen Ghannam <yazen.ghannam@....com>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: x86@...nel.org, Tony Luck <tony.luck@...el.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, linux-kernel@...r.kernel.org,
linux-edac@...r.kernel.org, Smita.KoralahalliChannabasappa@....com,
Qiuxu Zhuo <qiuxu.zhuo@...el.com>, linux-acpi@...r.kernel.org
Subject: Re: [PATCH v4 10/22] x86/mce: Remove __mcheck_cpu_init_early()
On Thu, Jun 26, 2025 at 11:03:20AM +0300, Nikolay Borisov wrote:
>
>
> On 6/24/25 17:16, Yazen Ghannam wrote:
> > The __mcheck_cpu_init_early() function was introduced so that some
> > vendor-specific features are detected before the first MCA polling event
> > done in __mcheck_cpu_init_generic().
> >
> > Currently, __mcheck_cpu_init_early() is only used on AMD-based systems and
> > additional code will be needed to support various system configurations.
> >
> > However, the current and future vendor-specific code should be done during
> > vendor init. This keeps all the vendor code in a common location and
> > simplifies the generic init flow.
> >
> > Move all the __mcheck_cpu_init_early() code into mce_amd_feature_init().
> >
> > Also, move __mcheck_cpu_init_generic() after
> > __mcheck_cpu_init_prepare_banks() so that MCA is enabled after the first
> > MCA polling event.
> >
> > Additionally, this brings the MCA init flow closer to what is described
> > in the x86 docs.
> >
> > The AMD PPRs say
> > "The operating system must initialize the MCA_CONFIG registers prior to
> > initialization of the MCA_CTL registers.
> >
> > The MCA_CTL registers must be initialized prior to enabling the error
> > reporting banks in MCG_CTL".
> >
> > However, the Intel SDM "Machine-Check Initialization Pseudocode" says
> > MCG_CTL first then MCi_CTL.
> >
> > But both agree that CR4.MCE should be set last.
> >
> > Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@...el.com>
> > Tested-by: Tony Luck <tony.luck@...el.com>
> > Reviewed-by: Tony Luck <tony.luck@...el.com>
> > Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
>
>
> IMO the change which moves __mcheck_cpu_init_generic should be in a separate
> patch so that in the changelog it's abundantly clear that it's a "world
> switch" function and its invocation timing is important.
>
> <snip>
>
>
> In any case:
>
> Reviewed-by: Nikolay Borisov <nik.borisov@...e.com>
Thanks for the review. I can split this in the next revision if needed.
Thanks,
Yazen
Powered by blists - more mailing lists