Re: [PATCH 02/26] x86/tdx: Extend the cc_platform_has() API to support TDX guests

From: Borislav Petkov
Date: Thu Dec 16 2021 - 13:33:54 EST


On Tue, Dec 14, 2021 at 06:02:40PM +0300, Kirill A. Shutemov wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
>
> Confidential Computing (CC) features (like string I/O unroll support,
> memory encryption/decryption support, etc) are conditionally enabled
> in the kernel using cc_platform_has() API. Since TDX guests also need
> to use these CC features, extend cc_platform_has() API and add TDX
> guest-specific CC attributes support.
>
> Use is_tdx_guest() API to detect for the TDX guest status and return
> TDX-specific CC attributes. To enable use of CC APIs in the TDX guest,
> select ARCH_HAS_CC_PLATFORM in the CONFIG_INTEL_TDX_GUEST case.
>
> This is a preparatory patch and just creates the framework for adding
> TDX guest specific CC attributes.
>
> Since is_tdx_guest() function (through cc_platform_has() API) is used in
> the early boot code, disable the instrumentation flags and function
> tracer. This is similar to AMD SEV and cc_platform.c.
>
> Since intel_cc_platform_has() function only gets triggered when

"... only gets called... "

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette