Re: [PATCHv5.2 04/30] x86/tdx: Extend the confidential computing API to support TDX guests

From: Borislav Petkov
Date: Tue Mar 15 2022 - 15:43:35 EST


On Thu, Mar 10, 2022 at 02:51:21AM +0300, Kirill A. Shutemov wrote:
> diff --git a/arch/x86/coco/core.c b/arch/x86/coco/core.c
> index fc1365dd927e..6529db059938 100644
> --- a/arch/x86/coco/core.c
> +++ b/arch/x86/coco/core.c
> @@ -87,9 +87,18 @@ EXPORT_SYMBOL_GPL(cc_platform_has);
>
> u64 cc_mkenc(u64 val)
> {
> + /*
> + * Both AMD and Intel use a bit in page table to indicate encryption

"... a bit in the page table ..."

> + * status of the page.
> + *
> + * - for AMD, bit *set* means the page is encrypted
> + * - for Intel *clear* means encrypted.
> + */
> switch (vendor) {
> case CC_VENDOR_AMD:
> return val | cc_mask;
> + case CC_VENDOR_INTEL:
> + return val & ~cc_mask;
> default:
> return val;
> }

With that fixed:

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

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