Skip to content

Commit a46b2bb

Browse files
yghannambp3tk0v
authored andcommitted
x86/mce: Do 'UNKNOWN' vendor check early
The 'UNKNOWN' vendor check is handled as a quirk that is run on each online CPU. However, all CPUs are expected to have the same vendor. Move the 'UNKNOWN' vendor check to the BSP-only init so it is done early and once. Remove the unnecessary return value from the quirks check. Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Nikolay Borisov <nik.borisov@suse.com> Tested-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/20250908-wip-mca-updates-v6-0-eef5d6c74b9c@amd.com
1 parent c6e465b commit a46b2bb

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

arch/x86/kernel/cpu/mce/core.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,14 +1977,11 @@ static void apply_quirks_zhaoxin(struct cpuinfo_x86 *c)
19771977
}
19781978

19791979
/* Add per CPU specific workarounds here */
1980-
static bool __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
1980+
static void __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
19811981
{
19821982
struct mca_config *cfg = &mca_cfg;
19831983

19841984
switch (c->x86_vendor) {
1985-
case X86_VENDOR_UNKNOWN:
1986-
pr_info("unknown CPU type - not enabling MCE support\n");
1987-
return false;
19881985
case X86_VENDOR_AMD:
19891986
apply_quirks_amd(c);
19901987
break;
@@ -2000,8 +1997,6 @@ static bool __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
20001997
cfg->monarch_timeout = 0;
20011998
if (cfg->bootlog != 0)
20021999
cfg->panic_timeout = 30;
2003-
2004-
return true;
20052000
}
20062001

20072002
static bool __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
@@ -2240,6 +2235,12 @@ void mca_bsp_init(struct cpuinfo_x86 *c)
22402235
if (!mce_available(c))
22412236
return;
22422237

2238+
if (c->x86_vendor == X86_VENDOR_UNKNOWN) {
2239+
mca_cfg.disabled = 1;
2240+
pr_info("unknown CPU type - not enabling MCE support\n");
2241+
return;
2242+
}
2243+
22432244
mce_flags.overflow_recov = cpu_feature_enabled(X86_FEATURE_OVERFLOW_RECOV);
22442245
mce_flags.succor = cpu_feature_enabled(X86_FEATURE_SUCCOR);
22452246
mce_flags.smca = cpu_feature_enabled(X86_FEATURE_SMCA);
@@ -2274,10 +2275,7 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
22742275

22752276
__mcheck_cpu_cap_init();
22762277

2277-
if (!__mcheck_cpu_apply_quirks(c)) {
2278-
mca_cfg.disabled = 1;
2279-
return;
2280-
}
2278+
__mcheck_cpu_apply_quirks(c);
22812279

22822280
if (!mce_gen_pool_init()) {
22832281
mca_cfg.disabled = 1;

0 commit comments

Comments
 (0)