RE: [PATCH v2 24/31] coco/tdx-host: Add a helper to exchange SPDM messages through DOE

From: Tian, Kevin

Date: Fri Apr 24 2026 - 03:02:25 EST


> From: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>
> Sent: Wednesday, April 22, 2026 5:41 PM
>
> On Thu, Apr 09, 2026 at 07:56:06AM +0000, Tian, Kevin wrote:
> > > From: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>
> > > Sent: Saturday, March 28, 2026 12:01 AM
> > > +
> > > +static int __maybe_unused tdx_spdm_msg_exchange(struct
> tdx_tsm_link
> > > *tlink,
> > > + void *request, size_t
> > > request_sz,
> > > + void *response, size_t
> > > response_sz)
> > > +{
> > > + struct pci_dev *pdev = tlink->pci.base_tsm.pdev;
> >
> > call it pci_spdm_msg_exchange() and pass in struct pci_dev directly.
>
> I don't think so. There is kernel managed spdm transfer support WIP,
> which is another topic. We don't want to mix the namespace with that
> one.

pci_spdm_raw_msg_exchange() then, since you said currently only
one user i.e. tdx?

If the kernel managed spdm doesn't support the raw format, then there
won't be conflict.

if it supports (i.e. the 2nd user), then this should be moved to pci core.

>
> And we also don't name it tsm_spdm_msg_exchange, cause TSM firmwares
> output different blobs for vendor TSM drivers to transfer. E.g. TDX
> Module outputs buffers with DOE header & SPDM header, other vendors
> (AMD IIRC) outputs buffers with only SPDM header. So this function is
> TDX specific.
>

TDX is just an user of that. All the logic here is about handling the
raw format, nothing specific to tdx.