Re: [PATCH v2 25/31] x86/virt/tdx: Add SEAMCALL wrappers for SPDM management
From: Xu Yilun
Date: Wed Apr 22 2026 - 06:13:37 EST
On Thu, Apr 09, 2026 at 07:59:33AM +0000, Tian, Kevin wrote:
> > From: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>
> > Sent: Saturday, March 28, 2026 12:01 AM
> >
>
> here ...
>
> > - TDH.SPDM.MNG supports three SPDM runtime operations: HEARTBEAT,
> > KEY_UPDATE and DEV_INFO_RECOLLECTION.
>
> ... but the actual helper just pass whatever ops to TDX module
Ah, yes. But only tdx-host driver which implements link encryption cares
about these operation code. My preference is only define general the
SEAMCALL wrapper format in TDX core as other SEAMCALL do. And leave the
specific op code definition in tdx-host driver.
I can revise the commit log as:
- TDH.SPDM.MNG supports various SPDM runtime operations: HEARTBEAT,
KEY_UPDATE, DEV_INFO_RECOLLECTION... These operation codes are defined
in tdx-host driver.
Thanks.
>
> > +u64 tdh_exec_spdm_mng(u64 spdm_id, u64 spdm_op, struct page
> > *spdm_param,
> > + struct page *spdm_rsp, struct page *spdm_req,
> > + struct tdx_page_array *spdm_out,
> > + u64 *spdm_req_or_out_len)
> > +{
> > + struct tdx_module_args args = {
> > + .rcx = spdm_id,
> > + .rdx = spdm_op,
> > + .r8 = spdm_param ? page_to_phys(spdm_param) : -1,
> > + .r9 = page_to_phys(spdm_rsp),
> > + .r10 = page_to_phys(spdm_req),
> > + .r11 = spdm_out ? hpa_array_t_assign_raw(spdm_out) : -1,
> > + };
> > + u64 r;
> > +
> > + r = seamcall_ret_ir_exec(TDH_SPDM_MNG, &args);
> > +
> > + *spdm_req_or_out_len = args.rcx;
> > +
> > + return r;
> > +}
> > +EXPORT_SYMBOL_FOR_MODULES(tdh_exec_spdm_mng, "tdx-host");