|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] x86/MCE: adjust S3 resume handling
commit d9b3aceae1ebe859c3aa8413bf0d90cfa508be54
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue May 12 08:31:31 2026 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue May 12 08:31:31 2026 +0200
x86/MCE: adjust S3 resume handling
The BSP resume path calls mcheck_init() with the address of
boot_cpu_data, thus rendering comparisons against that pointer
ineffective. The additional "bsp" boolean needs to be used (and
propagated as necessary) instead.
While touching intel_init_thermal(), constify its 1st parameter, which
in turn requires touching intel_thermal_supported() as well.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/arch/x86/cpu/mcheck/mce_amd.c | 4 ++--
xen/arch/x86/cpu/mcheck/mce_intel.c | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c
b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 25c29eb3d2..bf353c9a69 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -318,7 +318,7 @@ amd_mcheck_init(const struct cpuinfo_x86 *c, bool bsp)
mcequirk_amd_apply(quirkflag);
if ( cpu_has(c, X86_FEATURE_AMD_PPIN) &&
- (c == &boot_cpu_data || ppin_msr) )
+ (bsp || ppin_msr) )
{
uint64_t val;
@@ -333,7 +333,7 @@ amd_mcheck_init(const struct cpuinfo_x86 *c, bool bsp)
if ( !(val & PPIN_ENABLE) )
ppin_msr = 0;
- else if ( c == &boot_cpu_data )
+ else if ( bsp )
ppin_msr = MSR_AMD_PPIN;
}
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c
b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 839a0e5ba9..673e608376 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -87,7 +87,7 @@ static void cf_check intel_thermal_interrupt(void)
}
/* Thermal monitoring depends on APIC, ACPI and clock modulation */
-static bool intel_thermal_supported(struct cpuinfo_x86 *c)
+static bool intel_thermal_supported(const struct cpuinfo_x86 *c)
{
if ( !cpu_has_apic )
return false;
@@ -110,7 +110,7 @@ static void __init mcheck_intel_therm_init(void)
}
/* P4/Xeon Thermal regulation detect and init */
-static void intel_init_thermal(struct cpuinfo_x86 *c)
+static void intel_init_thermal(const struct cpuinfo_x86 *c, bool bsp)
{
uint64_t msr_content;
uint32_t val;
@@ -143,7 +143,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
if ( (msr_content & (1ULL<<3))
&& (val & APIC_DM_MASK) == APIC_DM_SMI )
{
- if ( c == &boot_cpu_data )
+ if ( bsp )
printk(KERN_DEBUG "Thermal monitoring handled by SMI\n");
return; /* -EBUSY */
}
@@ -154,7 +154,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
/* check whether a vector already exists, temporarily masked? */
if ( val & APIC_VECTOR_MASK )
{
- if ( c == &boot_cpu_data )
+ if ( bsp )
printk(KERN_DEBUG "Thermal LVT vector (%#x) already installed\n",
val & APIC_VECTOR_MASK);
return; /* -EBUSY */
@@ -852,7 +852,7 @@ static void intel_init_mce(bool bsp)
mce_uhandler_num = ARRAY_SIZE(intel_mce_uhandlers);
}
-static void intel_init_ppin(const struct cpuinfo_x86 *c)
+static void intel_init_ppin(const struct cpuinfo_x86 *c, bool bsp)
{
/*
* Even if testing the presence of the MSR would be enough, we don't
@@ -881,7 +881,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
case INTEL_SAPPHIRERAPIDS_X:
case INTEL_EMERALDRAPIDS_X:
- if ( (c != &boot_cpu_data && !ppin_msr) ||
+ if ( (!bsp && !ppin_msr) ||
rdmsr_safe(MSR_PPIN_CTL, &val) )
return;
@@ -894,7 +894,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
if ( !(val & PPIN_ENABLE) )
ppin_msr = 0;
- else if ( c == &boot_cpu_data )
+ else if ( bsp )
ppin_msr = MSR_PPIN;
break;
@@ -995,9 +995,9 @@ enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c,
bool bsp)
intel_init_cmci(c);
- intel_init_thermal(c);
+ intel_init_thermal(c, bsp);
- intel_init_ppin(c);
+ intel_init_ppin(c, bsp);
return mcheck_intel;
}
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |