RE: [PATCH v2 06/10] x86/mce: Convert multiple if () statements into a switch() statement

From: Luck, Tony
Date: Thu Oct 24 2024 - 12:42:42 EST


- if (c->x86 == 6 && c->x86_model < 0x1A && this_cpu_read(mce_num_banks) > 0)
+ if (c->x86_vfm < INTEL_NEHALEM_EP && this_cpu_read(mce_num_banks) > 0)
mce_banks[0].init = false;

Updated code now matches for families before 6 (486, Pentium). 486 would never get
to this code. But I think from the comments about machine check bank 0 being magic
that Pentium had some rudimentary support.

Should this be:
if (c->x86_vfm >= INTEL_PENTIUM_PRO && c->x86_vfm < INTEL_NEHALEM_EP && this_cpu_read(mce_num_banks) > 0)
to avoid this semantic change?

- if (c->x86 == 6 && c->x86_model <= 13 && cfg->bootlog < 0)
+ if (c->x86_vfm < INTEL_CORE_YONAH && cfg->bootlog < 0)
cfg->bootlog = 0;

Same as above. New code matches for families 4 and 5.

-Tony