Re: [PATCH v3 10/17] x86/mce: Separate global and per-CPU quirks

From: Borislav Petkov
Date: Thu Apr 17 2025 - 08:17:01 EST


On Tue, Apr 15, 2025 at 02:55:05PM +0000, Yazen Ghannam wrote:
> /* cpu init entry point, called from mce.c with preempt off */
> void mce_amd_feature_init(struct cpuinfo_x86 *c)
> {
> @@ -656,6 +678,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
> u32 low = 0, high = 0, address = 0;
> int offset = -1;
>
> + amd_apply_quirks(c);

<---- newline here.

> mce_flags.amd_threshold = 1;
>
> for (bank = 0; bank < this_cpu_read(mce_num_banks); ++bank) {

...

> @@ -2255,6 +2223,8 @@ void cpu_mca_init(struct cpuinfo_x86 *c)
>
> if (cap & MCG_SER_P)
> mca_cfg.ser = 1;
> +
> + __mcheck_cpu_apply_quirks(c);

Right, this is not a per-CPU init function anymore but a one-time thing and
called only here so put its contents here and whack it.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette