Re: [PATCH v6 4/5] x86/bugs: Declutter vulnerable CPU list
From: Pawan Gupta
Date: Thu Mar 06 2025 - 12:02:24 EST
On Thu, Mar 06, 2025 at 07:18:55AM -0800, Dave Hansen wrote:
> On 3/5/25 23:13, Pawan Gupta wrote:
> ...
> > #define VULNWL_INTEL(vfm, whitelist) \
> > - X86_MATCH_VFM(vfm, whitelist)
> > + X86_MATCH_VFM(INTEL_##vfm, whitelist)
>
> I think the new VFM code may have thrown you off here. Doing HASWELL_X
> is not as nice as INTEL_HASWELL_X because, while you can grep for it, it
> won't work when you're looking for full identifiers like with ctags or
> cscope.
>
> Also, this is just putting the "INTEL" in the macro instead of the VFM.
> I'm not sure there's much value in doing:
>
> VULNWL_INTEL(ALDERLAKE_L, ...)
>
> over:
>
> X86_MATCH_VFM(INTEL_ALDERLAKE_L, ...)
Ahh, right. I will fix that. Thanks for pointing this out.
As one of the goal of the patch is to shorten the macro names and follow
the VULNWL_<> pattern, would it make sense to rename VULNWL_INTEL to:
#define VULNWL_VFM(vfm, whitelist) \
X86_MATCH_VFM(vfm, whitelist)
Then the table would look like:
VULNWL_VFM(INTEL_TIGERLAKE, NO_MMIO),
Simlarly for cpu_vuln_blacklist the macros become:
#define VULNBL_VFM(vfm, issues) \
VULNBL_VFM_STEPS(vfm, X86_STEP_MAX, issues)
#define VULNBL_VFM_STEPS(vfm, max_stepping, issues) \
X86_MATCH_VFM_STEPS(vfm, X86_STEP_MIN, max_stepping, issues)
#define VULNBL_VFM_TYPE(vfm, cpu_type, issues) \
X86_MATCH_VFM_CPU_TYPE(vfm, \
INTEL_CPU_TYPE_##cpu_type, \
issues)
And the table would look like:
VULNBL_VFM(INTEL_COMETLAKE, MMIO | MMIO_SBDS | RETBLEED | GDS),
VULNBL_VFM_STEPS(INTEL_COMETLAKE_L, 0x0, MMIO | RETBLEED),
...
VULNBL_VFM_TYPE(INTEL_ALDERLAKE, ATOM, RFDS),