Re: [PATCH v8 03/11] x86/cpufeatures: Add TDX Guest CPU feature
From: Borislav Petkov
Date: Wed Oct 06 2021 - 08:47:45 EST
On Tue, Oct 05, 2021 at 10:03:09PM -0700, Josh Poimboeuf wrote:
> I'm not suggesting getting rid of the feature flag. I'm suggesting
> getting rid of the global variable. Is there a reason you can't check
> the feature flag instead of checking the global variable?
The reason is that cc_platform_has() is used too early, even before
get_cpu_cap(). So you need to have TDX guest detected even before
feature flags.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette