Re: [PATCH v7 01/12] x86/tdx: Add Intel ARCH support to cc_platform_has()

From: Dave Hansen
Date: Thu Sep 16 2021 - 15:57:34 EST


On 9/16/21 12:06 PM, Borislav Petkov wrote:
> On Thu, Sep 16, 2021 at 11:44:48AM -0700, Dave Hansen wrote:
>> How did this end up out of line? This means that if you compile-time
>> enable support for even *one* "cc" platform, you can't optimize the
>> calls away. This ends up being at *LEAST* two calls, just to get an
>> unconditional "false". That just seems silly.
>>
>> I know this is a comment more about the cc_platform_has() series that
>> this one, but this compounds the problem.
> Posting here too for the wider audience - follow this thread pls:
>
> https://lkml.kernel.org/r/9d4fc3f8ea7b325aaa1879beab1286876f45d450.1631141919.git.thomas.lendacky@xxxxxxx

It sounds like the argument boils down to: out-of-line is cleaner,
especially considering the cross-arch implementation. Inlines can turn
into a mess, so make it out-of-line unless an *actual* real-world
benefit emerges.