[PATCH] x86/MCE: don't treat S3 resume the same as boot

Jan Beulich posted 1 patch 1 year, 5 months ago
Failed in applying to current master (apply log)
[PATCH] x86/MCE: don't treat S3 resume the same as boot
Posted by Jan Beulich 1 year, 5 months ago
Checks for running on CPU0 are bogus; they identify S3 resume the same
as being the BSP while booting. Replace with the same check we use
elsewhere to properly limit things to just the BSP.

Link: https://gitlab.com/xen-project/xen/-/jobs/6966698361
Fixes: 19b6e9f9149f ("x86/MCE: optional build of AMD/Intel MCE code")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -767,7 +767,7 @@ static void intel_init_mca(struct cpuinf
         lmce = intel_enable_lmce();
 
 #define CAP(enabled, name) ((enabled) ? ", " name : "")
-    if ( smp_processor_id() == 0 )
+    if ( c == &boot_cpu_data )
     {
         dprintk(XENLOG_INFO,
                 "MCA Capability: firstbank %d, extended MCE MSR %d%s%s%s%s\n",
Re: [PATCH] x86/MCE: don't treat S3 resume the same as boot
Posted by Andrew Cooper 1 year, 5 months ago
On 29/05/2024 11:46 am, Jan Beulich wrote:
> Checks for running on CPU0 are bogus; they identify S3 resume the same
> as being the BSP while booting. Replace with the same check we use
> elsewhere to properly limit things to just the BSP.
>
> Link: https://gitlab.com/xen-project/xen/-/jobs/6966698361
> Fixes: 19b6e9f9149f ("x86/MCE: optional build of AMD/Intel MCE code")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/cpu/mcheck/mce_intel.c
> +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
> @@ -767,7 +767,7 @@ static void intel_init_mca(struct cpuinf
>          lmce = intel_enable_lmce();
>  
>  #define CAP(enabled, name) ((enabled) ? ", " name : "")
> -    if ( smp_processor_id() == 0 )
> +    if ( c == &boot_cpu_data )

Look at the callers of this function.

This doesn't help in the slightest, because mcheck_init() is
extra-specially wonky.

~Andrew