Skip to contentSkip to conversation

x86/mce: Sort headers

PATCH In review Andrew Cooper 2 participants 4 messages Aug 21, 2025 – Aug 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86/mce: Sort headers

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/cpu/mcheck/mce_intel.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
xen/arch/x86/cpu/mcheck/mce_intel.c +14 -13
index 1e52b1ac25a4..d1d61bc95069 100644
@@ -1,29 +1,30 @@
+#include <xen/cpu.h>
+#include <xen/delay.h>
+#include <xen/event.h>
 #include <xen/init.h>
-#include <xen/types.h>
 #include <xen/irq.h>
-#include <xen/event.h>
 #include <xen/kernel.h>
-#include <xen/delay.h>
+#include <xen/mm.h>
 #include <xen/param.h>
 #include <xen/smp.h>
-#include <xen/mm.h>
-#include <xen/cpu.h>
-#include <asm/processor.h>
-#include <public/sysctl.h>
-#include <asm/system.h>
+
+#include <asm/apic.h>
+#include <asm/mce.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
-#include <asm/mce.h>
-#include <asm/apic.h>
+#include <asm/processor.h>
+#include <asm/system.h>
 
 #include <acpi/cpufreq/cpufreq.h>
 
-#include "mce.h"
-#include "x86_mca.h"
+#include <public/sysctl.h>
+
 #include "barrier.h"
+#include "mcaction.h"
+#include "mce.h"
 #include "util.h"
 #include "vmce.h"
-#include "mcaction.h"
+#include "x86_mca.h"
 
 static DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, mce_banks_owned);
 static bool __read_mostly ser_support;
Signature · 1 line
2.39.5
#1 lore raw

PATCH 2/2 x86/mce: Adjustments to intel_init_ppin()

There's no family check gating intel_init_ppin(), making it incorrect to use on non Fam6 CPUs. Switch to using VFM.

Emerald Rapids is the final CPU to have PPIN but lack the the architectural enumeration, so include it too.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/cpu/mcheck/mce_intel.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
xen/arch/x86/cpu/mcheck/mce_intel.c +11 -9
index d1d61bc95069..16f286566ce7 100644
@@ -9,6 +9,7 @@
 #include <xen/smp.h>
 
 #include <asm/apic.h>
+#include <asm/intel-family.h>
 #include <asm/mce.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
@@ -859,7 +860,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
      * other purposes.  Despite the late addition of a CPUID bit (rendering
      * the MSR architectural), keep using the same detection logic there.
      */
-    switch ( c->x86_model )
+    switch ( c->vfm )
     {
         uint64_t val;
 
@@ -870,14 +871,15 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
             return;
         }
         fallthrough;
-    case 0x3e: /* IvyBridge X */
-    case 0x3f: /* Haswell X */
-    case 0x4f: /* Broadwell X */
-    case 0x55: /* Skylake X */
-    case 0x56: /* Broadwell Xeon D */
-    case 0x6a: /* Icelake X */
-    case 0x6c: /* Icelake D */
-    case 0x8f: /* Sapphire Rapids X */
+    case INTEL_IVYBRIDGE_X:
+    case INTEL_HASWELL_X:
+    case INTEL_BROADWELL_X:
+    case INTEL_BROADWELL_D:
+    case INTEL_SKYLAKE_X:
+    case INTEL_ICELAKE_X:
+    case INTEL_ICELAKE_D:
+    case INTEL_SAPPHIRERAPIDS_X:
+    case INTEL_EMERALDRAPIDS_X:
 
         if ( (c != &boot_cpu_data && !ppin_msr) ||
              rdmsr_safe(MSR_PPIN_CTL, val) )
Signature · 1 line
2.39.5
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] x86/mce: Adjustments to intel_init_ppin()

Quoted 7 lines · Andrew Cooper

There's no family check gating intel_init_ppin(), making it incorrect to use on non Fam6 CPUs. Switch to using VFM.

Emerald Rapids is the final CPU to have PPIN but lack the the architectural enumeration, so include it too.