Re: [PATCH PATCH 9/9] x86/rfds: Exclude P-only parts from the RFDS affected list
From: Pawan Gupta
Date: Mon Jun 17 2024 - 14:36:20 EST
On Mon, Jun 17, 2024 at 07:34:22AM -0700, Dave Hansen wrote:
> On 6/17/24 02:43, Andrew Cooper wrote:
> > On 17/06/2024 10:12 am, Pawan Gupta wrote:
> >> + VULNBL_INTEL_CPU_TYPE (RAPTORLAKE, X86_CPU_TYPE_INTEL_ATOM, RFDS),
> >> + VULNBL_INTEL_CPU_TYPE (ALDERLAKE, X86_CPU_TYPE_INTEL_ATOM, RFDS),
> >
> > How does this work?
> >
> > Being __initconst, this is only evaluated on the BSP.
> >
> > P-only and mixed P/E systems won't see X86_CPU_TYPE_INTEL_ATOM, even if
> > there are ATOM APs to bring up later.
>
> The X86_CPU_TYPE_* is only used on the boot CPU on non-hybrids. Hybrids
> (independent of the boot CPU type) should be considered vulnerable no
> matter what.
Yes. This is done in x86_match_cpu_type(), that matches all cpu-types on hybrids:
static bool x86_match_cpu_type(struct cpuinfo_x86 *c, const struct x86_cpu_id)
{
if (m->cpu_type == X86_CPU_TYPE_ANY)
return true;
/* Hybrid CPUs are special, they are assumed to match all cpu-types */
if (boot_cpu_has(X86_FEATURE_HYBRID_CPU))
return true;
return c->topo.cpu_type == m->cpu_type;
}