From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "Gao, Chao" <chao.gao@intel.com>
Cc: "hpa@zytor.com" <hpa@zytor.com>, "Xu, Yilun" <yilun.xu@intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"baolu.lu@linux.intel.com" <baolu.lu@linux.intel.com>,
"Peng, Chao P" <chao.p.peng@intel.com>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"x86@kernel.org" <x86@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
"Tian, Kevin" <kevin.tian@intel.com>,
"tglx@kernel.org" <tglx@kernel.org>,
"kas@kernel.org" <kas@kernel.org>
Subject: Re: [RFC PATCH 1/7] coco/tdx-host: Create metadata for an SPDM session
Date: Mon, 30 Nov 2026 22:08:07 +0000 [thread overview]
Message-ID: <73f765130067dc608532294b555e97f59b51e992.camel@intel.com> (raw)
In-Reply-To: <awzkWJ3aM6buVQm1@intel.com>
On Mon, 2026-11-30 at 10:50 +0800, Chao Gao wrote:
> On Sat, Nov 21, 2026 at 10:05:50AM +0800, Edgecombe, Rick P wrote:
> > On Mon, 2026-11-16 at 03:10 -0800, Chao Gao wrote:
> > > The TDX module talks to the device over a Security Protocol and Data
> > > Model (SPDM) session. It needs host memory for each session's metadata,
> > > and reports the number of pages required in its global metadata.
> >
> > Since we usually talk about metadata and mean the global metadata, we will
> > probably need to explain what session metadata is. Is it just data?
>
> Yes. It is used to keep the TDX module's own state for one SPDM
> session, for example, the session keys.
>
> > >
> > > When setting up an SPDM session, allocate the memory and hand it to the
> > > TDX module with TDH.SPDM.CREATE. Keep the returned session ID for later
> > > SEAMCALLs.
> > >
> >
> > This is getting to be a pretty familiar concept. TDX needs per-something scoped
> > memory. Give it to the TDX module per some seamcall. Can we make it sounds
> > especially ordinary and then just call out any thing that is different?
>
> How about:
>
> To set up link encryption, the TDX module talks to the device over
> a Security Protocol and Data Model (SPDM) session.
>
> An SPDM session is an object like a TD or a vCPU. They are managed
> by the TDX module in the same way. Each has SEAMCALLs to create and
> delete it, and the TDX module keeps its state for the object in
> memory provided by the host.
>
> Allocate the memory when setting up a session and give it to the
> TDX module. Get it back when tearing the session down.
>
> Creating a session returns a session ID, which later SEAMCALLs use
> to identify the session. Store it.
Looks good.
>
> > > 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.
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.
> >
next prev parent reply other threads:[~2026-11-30 22:08 UTC|newest]
Thread overview: 31+ 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 [this message]
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-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=73f765130067dc608532294b555e97f59b51e992.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 \
/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