Re: [PATCH v2 08/16] x86/mce: Define BSP-only SMCA init

From: Yazen Ghannam
Date: Wed Feb 19 2025 - 11:02:58 EST


On Tue, Feb 18, 2025 at 03:33:08AM +0000, Zhuo, Qiuxu wrote:
> > From: Yazen Ghannam <yazen.ghannam@xxxxxxx>
> > Sent: Friday, February 14, 2025 12:46 AM
> > To: x86@xxxxxxxxxx; Luck, Tony <tony.luck@xxxxxxxxx>
> > Cc: linux-kernel@xxxxxxxxxxxxxxx; linux-edac@xxxxxxxxxxxxxxx;
> > Smita.KoralahalliChannabasappa@xxxxxxx; Yazen Ghannam
> > <yazen.ghannam@xxxxxxx>
> > Subject: [PATCH v2 08/16] x86/mce: Define BSP-only SMCA init
> >
> > Currently on AMD systems, MCA interrupt handler functions are set during
> > CPU init. However, the functions only need to be set once for the whole
> > system.
> >
> > Assign the handlers only during BSP init. Do so only for SMCA systems to
> > maintain the old behavior for legacy systems.
>
> Looks like the interrupt handler is still set during each per-CPU online, right?
> What's the benefit/purpose of this patch? Thanks!
>

This patch is doing the "correct" thing.

> mce_cpu_online(cpu)
> mce_threshold_create_device(cpu) {
> ...
> mce_threshold_vector = amd_threshold_interrupt;
> ...
> }
>

This part remains for legacy systems. However, I think this is another
place to do more cleanup later.

Thanks,
Yazen