Re: [RFC PATCH 2/7] coco/tdx-host: Establish an SPDM session with the device

From: Chao Gao

Date: Mon Nov 30 2026 - 06:41:27 EST


On Sat, Nov 28, 2026 at 05:25:14PM +0800, Xu Yilun wrote:
>> > > > Pass the messages through two pages per device, one for each direction.
>> > > > One pair is enough because PCI/TSM serializes operations on a device.
>> > >
>> > > This probably needs more explanation.
>
>Though this is not the answer to Rick's concern...

Right, I misread Rick's comment as asking why one pair is enough.

>> I mean there is a buffer for request and a separate buffer for the response.
>> Once the request is sent, why can't the same buffer be used to read back the
>> response? This may be a lack of understanding by me of DOE.
>
>I believe it is possible. The DOE protocol defines serialized
>request/response flow. And the pci_doe() code does so, the entire
>request payload must be sent before receiving any response payload.
>
>I didn't try on real TDX module if tdh_spdm_connect/disconnect/mng can
>work with one buffer, but don't see reason why it can't.

Using the same buffer may work, but I do not think it is worth doing
now. Both pci_doe() and the TDX module's SPDM SEAMCALLs take separate
request and response buffers, and neither says that the two may
overlap. The saving would only be one page per device. And the AMD
implementation and the upcoming Arm series [1] use two buffers as well.

[1]: https://lore.kernel.org/all/20260910140509.868402-4-aneesh.kumar@xxxxxxxxxx/