lkml.org 
[lkml]   [2021]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v10 04/11] x86/tdx: Add TDX support to intel_cc_platform_has()
From
Date

On 10/14/21 12:12 AM, Thomas Gleixner wrote:
> On Fri, Oct 08 2021 at 22:37, Kuppuswamy Sathyanarayanan wrote:
>>
>> -static bool __maybe_unused intel_cc_platform_has(enum cc_attr attr)
>> +static bool intel_cc_platform_has(enum cc_attr attr)
>> {
>> #ifdef CONFIG_INTEL_TDX_GUEST
>> - return false;
>> + switch (attr) {
>> + case CC_ATTR_GUEST_TDX:
>> + return is_tdx_guest();
> This function is only called when is_tdx_guest() is true. So
> is_tdx_guest() has to be called again to make sure?


Agree. In future, if intel_cc_platform_has() is used in non-tdx case then
we can add is_tdx_guest() back there. For now it is redundant
as you have mentioned. I will remove it in next version.

>
> Also the ifdeffery can just go away simply because the compiler will
> discard this function when CONFIG_INTEL_TDX_GUEST=n due to:
Agree. I will remove it.
>
>> +#ifdef CONFIG_INTEL_TDX_GUEST
>> +
>> +bool is_tdx_guest(void);
>> +void __init tdx_early_init(void);
>> +
>> +#else
>> +
>> +static inline bool is_tdx_guest(void) { return false; }
>> +static inline void tdx_early_init(void) { };
>> +
>> +#endif /* CONFIG_INTEL_TDX_GUEST */
> Thanks,
>
> tglx

--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

\
 
 \ /
  Last update: 2021-10-14 19:52    [W:0.110 / U:3.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site