Re: [PATCH v8 07/21] coco/tdx-host: Implement firmware upload sysfs ABI for TDX module updates

From: Chao Gao

Date: Tue May 05 2026 - 22:37:09 EST


On Wed, Apr 29, 2026 at 04:17:10PM -0700, Dave Hansen wrote:
>On 4/27/26 08:28, Chao Gao wrote:
>> Linux kernel supports two primary firmware update mechanisms:
>> - request_firmware()
>> - firmware upload (or fw_upload)
>
>All the stuff here is good info, but it was hard to extract the
>implementation information from the background.
>
>I think this would do:
>
> Select fw_upload for doing TDX module updates. The process of
> selecting among available update images is complicated and
> nuanced. Punt the selection policy out to userspace.

Agreed. I'll add that as a TL;DR.

>
>...
>> +static int seamldr_init(struct device *dev)
>> +{
>> + struct fw_upload *tdx_fwl;
>> +
>> + if (!can_expose_seamldr())
>> + return 0;
>
>can_expose_seamldr() has a not great name.
>
>Why not just have naming that says:
>
> if (supports_runtime_update())
> ...
>
>Why abstract this out to what can or can't be exposed?

Sure, I'll use supports_runtime_update().

I originally used can_expose_seamldr() because I was focused on the
VMCS-clobbering erratum, where SEAMLDR sysfs cannot be exposed to
userspace.