Re: [PATCH] x86/CPU/AMD: Perform function calls post ZEN feature check regardless
From: Tom Lendacky
Date: Tue Aug 12 2025 - 17:58:34 EST
On 8/12/25 16:37, Borislav Petkov wrote:
> On Wed, Jul 23, 2025 at 12:01:06PM -0500, Tom Lendacky wrote:
>> Currently, if a ZEN family/model is not recognized in bsp_init_amd(), then
>> function calls after the family/model check are skipped. This can prevent
>> older kernels from enabling features on newer hardware, e.g., unrecognized
>> new hardware won't enable SEV-SNP because bsp_determine_snp() is skipped.
>
> bsp_determine_snp() relies partly on the family detection.
>
> If all you care is calling it even without family detection, why don't you
> pull it up, check c->x86 and be done with it?
ZEN3 and ZEN4 won't be set if we do that and since those families don't
have RMPREAD support, SNP won't get enabled on ZEN3 or ZEN4, so we can't
do that.
And, additionally, now there is tsa_init() and the CPUID_FAULT checks
that will be skipped, too.
>
> But even then: we don't really care about older kernels on newer hardware
> - that's why they get backports. We don't really think about backporting when
> working upstream. Frankly...
Hmmm... i guess? Not sure I 100% agree with that.
>
> So I'm sceptical about this.
Your call.
Thanks,
Tom
>