From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "Gao, Chao" <chao.gao@intel.com>,
"yilun.xu@linux.intel.com" <yilun.xu@linux.intel.com>
Cc: "kas@kernel.org" <kas@kernel.org>,
"Xu, Yilun" <yilun.xu@intel.com>, "bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"Peng, Chao P" <chao.p.peng@intel.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"baolu.lu@linux.intel.com" <baolu.lu@linux.intel.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
"tglx@kernel.org" <tglx@kernel.org>,
"Tian, Kevin" <kevin.tian@intel.com>
Subject: Re: [RFC PATCH 2/7] coco/tdx-host: Establish an SPDM session with the device
Date: Tue, 1 Dec 2026 19:05:31 +0000 [thread overview]
Message-ID: <f4ec9b0d31f046cccbaecd65fa0ecd8406cdf437.camel@intel.com> (raw)
In-Reply-To: <aw5TtSr546nZnBAI@intel.com>
On Tue, 2026-12-01 at 12:57 +0800, Chao Gao wrote:
> I looked into the history of pci_doe() and the AMD implementation
> again, so here is a more complete answer.
>
> Nobody has discussed why pci_doe() accepts two buffers on the list. The
> API has taken separate request and response buffers since its first
> posting [1].
>
> AMD SEV-TIO [2] cannot share them. The firmware writes the request, so that
> buffer must be a firmware-owned page, which the host cannot write. The
> host writes the response, so that buffer must be host-writable. The
> pci_doe() was not designed for this, but it fits.
So there was no discussion, but there is a good reason to have two different
ones on the DOE side. What happens if we just pass the same buffer into the
request and response?
>
> TDX has no such constraint, and both buffers are normal host pages. One
> buffer would likely work. But it would rely on pci_doe() sending the
> whole request before storing any of the response, and on the TDX module
> accepting the same page for both directions. Neither is documented. And
> the code would get harder to follow. The same page would be passed as
> both the const request and the response
>
Ah, ok. Yea that is too weird. Please ignore the above.
> , which needs a comment to
> explain why it is safe. The SEAMCALL wrappers would either take the same
> page twice or drop a parameter and no longer match the SEAMCALL ABI. All
> of that would save one page per device, so I would keep two buffers.
How about just add a log blurb like:
The DOE subsystem requires different request and response buffers, which is
necessary to work with SNP.[n] Allocate two buffers on the TDX side to avoid
introducing divergent DOE flows unified.
[n] https://this-thread
>
> Please let me know if you see it differently.
>
> [1]: https://lore.kernel.org/linux-pci/7ced46eaf68bed71b6414a93ac41f26cfd54a991.1669608950.git.lukas@wunner.de/
> [2]: https://docs.amd.com/v/u/en-US/58271_PUB_SEV-TIO Chapter 5.1
next prev parent reply other threads:[~2026-12-01 19:05 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 11:10 [RFC PATCH 0/7] TDX: Enable PCIe link encryption for trusted I/O Chao Gao
2026-11-16 11:10 ` [RFC PATCH 1/7] coco/tdx-host: Create metadata for an SPDM session Chao Gao
2026-11-21 2:05 ` Edgecombe, Rick P
2026-11-30 2:50 ` Chao Gao
2026-11-30 22:08 ` Edgecombe, Rick P
2026-12-01 5:01 ` Chao Gao
2026-11-16 11:10 ` [RFC PATCH 2/7] coco/tdx-host: Establish an SPDM session with the device Chao Gao
2026-11-23 23:23 ` Edgecombe, Rick P
2026-11-24 12:59 ` Chao Gao
2026-11-24 21:11 ` Edgecombe, Rick P
2026-11-28 9:25 ` Xu Yilun
2026-11-30 11:40 ` Chao Gao
2026-12-01 4:57 ` Chao Gao
2026-12-01 19:05 ` Edgecombe, Rick P [this message]
2026-11-28 9:35 ` Xu Yilun
2026-11-30 12:20 ` Chao Gao
2026-11-16 11:10 ` [RFC PATCH 3/7] coco/tdx-host: Exchange SPDM messages through DOE Chao Gao
2026-11-24 0:02 ` Edgecombe, Rick P
2026-11-24 11:57 ` Chao Gao
2026-11-24 22:02 ` Edgecombe, Rick P
2026-11-25 12:12 ` Chao Gao
2026-11-25 17:48 ` Edgecombe, Rick P
2026-11-28 12:42 ` Xu Yilun
2026-11-30 22:09 ` Edgecombe, Rick P
2026-11-28 9:47 ` Xu Yilun
2026-11-30 12:53 ` Chao Gao
2026-11-16 11:10 ` [RFC PATCH 4/7] coco/tdx-host: Pass a device info buffer to tdh_spdm_connect() Chao Gao
2026-11-16 11:10 ` [RFC PATCH 5/7] coco/tdx-host: Configure an IDE stream Chao Gao
2026-11-28 13:17 ` Xu Yilun
2026-11-30 13:00 ` Chao Gao
2026-11-16 11:10 ` [RFC PATCH 6/7] coco/tdx-host: Program IDE keys and enable the " Chao Gao
2026-11-16 11:10 ` [RFC PATCH 7/7] x86/virt/tdx: Enable PCIe link encryption Chao Gao
2026-11-21 1:35 ` [RFC PATCH 0/7] TDX: Enable PCIe link encryption for trusted I/O Edgecombe, Rick P
2026-11-30 11:11 ` Chao Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4ec9b0d31f046cccbaecd65fa0ecd8406cdf437.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=bp@alien8.de \
--cc=chao.gao@intel.com \
--cc=chao.p.peng@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kas@kernel.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=yilun.xu@intel.com \
--cc=yilun.xu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox