Re: [RFC PATCH 3/7] coco/tdx-host: Exchange SPDM messages through DOE

From: Edgecombe, Rick P

Date: Tue Nov 24 2026 - 17:02:22 EST


On Tue, 2026-11-24 at 19:57 +0800, Chao Gao wrote:
> > You mentioned DOE rebuilds the header. It looks like it doesn't have structs
> > like these because it uses FIELD_PREP with masks. So then we just have
> > duplicate
> > definitions of the format. Ugh.
>
> Yes. The earlier version [1] used the masks, and I found all the
> le32_to_cpu() and FIELD_PREP() hard to read. I would prefer to keep
> the structs as long as this code stays in the TDX-TSM driver.
>
> > Yea, this is just really unfortunate like you pointed in the coverletter. We
> > unwrap the header using all of this gunk to pass it through and then rebuild
> > the
> > header on the other side.
>
> I am now leaning towards moving this code into PCI/DOE, even though
> TDX would be its only user. Stripping and rebuilding the header is DOE
> format handling, and the PCI/DOE core already has the definitions and
> the code for it. A TSM driver should not need a second copy, no matter
> how many users there are. That would also remove the duplicate
> definitions above.

Can you elaborate on your proposal? What exactly moves to DOE and how does it
interop with the other DOE callers?