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

From: Josh Poimboeuf
Date: Wed Oct 13 2021 - 20:25:20 EST


On Thu, Oct 14, 2021 at 01:19:23AM +0200, Thomas Gleixner wrote:
> I'm amazed that it's so hard to see that this
>
> use()
> init()
>
> pattern is broken to begin with.
>
> So why are you arguing about the placement of this variable in the first
> place instead of actually looking at the code, wondering about the
> obscenity and then asking about the call ordering?
>
> In case that I might miss something important here due to my lack of CS
> education, please let me know.

I agree that's better.

I'd suggested doing setup_force_cpu_cap(X86_FEATURE_TDX_GUEST) early,
and then just check that instead of needing this new static variable. I
think Boris said that's not possible because of some ordering reasons
which are eluding me (and I didn't have time to investigate).

--
Josh