Re: [PATCH] x86/cacheinfo: fix a -Wtype-limits warning

From: Borislav Petkov
Date: Wed Jun 19 2019 - 13:06:47 EST


On Wed, Jun 05, 2019 at 01:07:04PM -0700, Sean Christopherson wrote:
> Might be worth calling out in the changelog that 'c->x86 == 0x17' is true
> if and only if c->x86_model was explicitly set by cpu_detect(), i.e. the
> patch is correct even if the original intent was a misguided attempt to
> check that x86_model has been set.

Are you thinking about some sick virt scenario where base CPUID level is < 1?

In this particular case, there's a guard at the beginning of
cacheinfo_amd_init_llc_id():

if (!cpuid_edx(0x80000006))
return;

but if there's CPUs which have CPUID 0x80000006 but base CPUID level is
< 1, then that's their problem.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.