Re: [PATCH v13 1/3] x86/tdx: Add TDX Guest attestation interface driver
From: Sathyanarayanan Kuppuswamy
Date: Wed Sep 14 2022 - 20:30:59 EST
On 9/14/22 9:12 AM, Dave Hansen wrote:
> On 9/14/22 08:36, Sathyanarayanan Kuppuswamy wrote:
>> When we initially submitted the attestation patches, virt/coco folder
>> was not created. I initially kept this driver in platform/x86/, but
>> later moved to arch/x86/coco based on the review comments in v4. There
>> was a discussion about the need for a new config and the location of
>> the driver. The outcome of that discussion is, since this is not a
>> traditional driver, but a basic TDX feature, we don't need a special
>> config and the code can be maintained in the arch/x86/coco folder.
>
> Could you please include the following in this set somewhere:
>
> "The code to do the SEV analog of this TDX functionality is in
> ___insert_path_here____. This code is different from that because
> ______reason______ so it is instead placed in ____other_path____."
>
> ?
I have also included info about why we don't use a separate config
option for it.
The code for the SEV equivalent of this TDX attestation functionality
can be found in drivers/virt/coco/sev-guest/. It is implemented as a
platform module driver, and it can be enabled using the CONFIG_SEV_GUEST
config option. However, in the case of TDX, it is implemented as a
built-in driver in the arch/x86/coco/tdx/tdx.c because of the following
reasons:
1. Attestation is expected to be needed by all distributions that support
TDX. Therefore, using a separate configuration option is not necessary.
With TDX support, it can be enabled by default, and a built-in driver
model will work better in this use case.
2. Since it is not a conventional device driver and the code is very simple,
creating an individual driver for it may be an overkill.
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer