Re: [PATCH v7 034/120] x86/cacheinfo: Use parsed CPUID(0x8000001d)

"Ahmed S. Darwish" <[email protected]> Mon, 1 Jun 2026 21:59:19 +0200
Newsgroups dev.linux.lists.x86-cpuid,org.kernel.vger.linux-kernel
Message-ID <ah3kl0nX8Xx_IhkT@lx-t490>
On Mon, 01 Jun 2026, Maciej Wieczor-Retman wrote:
>
> On 2026-05-28 at 17:37:56 +0200, Ahmed S. Darwish wrote:
> >
> > -static int amd_fill_cpuid4_info(int index, struct _cpuid4_info *id4)
> > +static int amd_fill_cpuid4_info(struct cpuinfo_x86 *c, int index, struct _cpuid4_info *id4)
> >  {
> >  	union _cpuid4_leaf_eax eax;
> >  	union _cpuid4_leaf_ebx ebx;
> >  	union _cpuid4_leaf_ecx ecx;
> > -	u32 ignored;
> >
> > -	if (boot_cpu_has(X86_FEATURE_TOPOEXT) || boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
> > -		cpuid_count(0x8000001d, index, &eax.full, &ebx.full, &ecx.full, &ignored);
> > -	else
> > +	if (boot_cpu_has(X86_FEATURE_TOPOEXT) || boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
> > +		const struct cpuid_regs *regs = cpuid_subleaf_n_raw(c, 0x8000001d, index);
> > +
> > +		if (!regs)
> > +			return -EIO;
> > +
> > +		eax.full = regs->eax;
> > +		ebx.full = regs->ebx;
> > +		ecx.full = regs->ecx;
> > +	} else
> > 		legacy_amd_cpuid4(index, &eax, &ebx, &ecx);
>
> This 'else' branch still needs the curly brackets per formatting standards.
>

ACK on this and all your other emails with stylistic remarks.