RE: [PATCH] EDAC/mce_amd: Reduce unnecessary spew in dmesg if SMCA feature bit is not exposed

From: Luck, Tony
Date: Mon Jun 14 2021 - 18:25:42 EST


> But apparently those wrong error messages bug people on a regular basis
> and I'm tired of typing this each time so I'll take a different version
> of this patch: check X86_FEATURE_HYPERVISOR on entry in mce_amd_init()
> and return -ENODEV if set.
>
> So that this is done once and for all.

I expect all the Intel EDAC drivers that load based on CPU model have similar
issues. Maybe they aren't whining as loudly about not being able to find the
memory controller devices?

They should also check for X86_FEATURE_HYPERVISOR too.

$ git grep -l x86_match_cpu -- drivers/edac
drivers/edac/amd64_edac.c
drivers/edac/i10nm_base.c
drivers/edac/ieh_edac.c
drivers/edac/pnd2_edac.c
drivers/edac/sb_edac.c
drivers/edac/skx_base.c

Though perhaps this is an issue outside of EDAC and x86_match_cpu()
could do the HYPERVISOR check and return no match. The few callers
who want to believe the fictional CPU model number passed in by the
VMM would need to use some new variant of the call?

-Tony