Re: [RFC PATCH 1/7] coco/tdx-host: Create metadata for an SPDM session

From: Chao Gao

Date: Tue Dec 01 2026 - 00:01:28 EST


On Tue, Dec 01, 2026 at 06:08:07AM +0800, Edgecombe, Rick P wrote:
>> > > When tearing the session down, reclaim the memory with
>> > > TDH.SPDM.DELETE. If that fails, leak the memory, as the TDX module may
>> > > still be using it.
>> >
>> > When would it fail?
>>
>> It shouldn't in practice. Per the spec, it fails if the input is wrong,
>> if the session is still in use (by another SEAMCALL or by an IDE
>> stream that has not been torn down), or if the TDX module extension
>> hit a fatal error. Any of them would be unexpected. They mean a bug in
>> the kernel or in the TDX module, or an earlier failure to tear down
>> the IDE stream.
>>
>> I would just say in the changelog that TDH.SPDM.DELETE should not
>> fail, and WARN_ON() and leak the memory if it does.
>
>I think we really need to strip these patches down to the bare minimum for the
>initial upstreaming. We see this again and again and just need lots of revisions
>to get them down to the true bare minimum. So let's just start there.

Agreed. I will go through the series again and drop everything that is
not needed for the initial upstreaming.

>
>In this case we could just WARN and have have no special logic around surviving
>the bug. It is the simplest way to not have it look weird ignoring the error.

Will do.