Re: [PATCH v8 03/11] x86/cpufeatures: Add TDX Guest CPU feature

From: Josh Poimboeuf
Date: Wed Oct 06 2021 - 10:11:15 EST


On Wed, Oct 06, 2021 at 02:47:42PM +0200, Borislav Petkov wrote:
> 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.

Ok. At least it sounds like cc_platform_has() needs a comment stating
that caps can't be relied on, and why.

--
Josh