Re: [PATCH v7 3/4] x86/cpu: Update x86_match_cpu() to also use cpu-type

From: Borislav Petkov
Date: Mon Mar 10 2025 - 06:52:27 EST


On Thu, Mar 06, 2025 at 06:18:36PM -0800, Pawan Gupta wrote:
> +static bool x86_match_vendor_cpu_type(struct cpuinfo_x86 *c, const struct x86_cpu_id *m)
> +{
> + 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))

check_for_deprecated_apis: WARNING: arch/x86/kernel/cpu/match.c:25: Do not use boot_cpu_has() - use cpu_feature_enabled() instead.

> + return true;
> +
> + if (c->x86_vendor == X86_VENDOR_INTEL)
> + return m->cpu_type == c->topo.intel_type;
> + if (c->x86_vendor == X86_VENDOR_AMD)
> + return m->cpu_type == c->topo.amd_type;
> +
> + return false;
> +}

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette