From: Kiryl Shutsemau <kas@kernel.org>
To: Xu Yilun <yilun.xu@linux.intel.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
rick.p.edgecombe@intel.com, dave.hansen@intel.com,
dave.hansen@linux.intel.com, yilun.xu@intel.com,
chao.gao@intel.com, djbw@kernel.org, linux-coco@lists.linux.dev,
peter.fang@intel.com, xiaoyao.li@intel.com
Subject: Re: [PATCH v2] x86/virt/tdx: Formalize SEAMCALL version encoding support
Date: Fri, 10 Jul 2026 16:56:49 +0100 [thread overview]
Message-ID: <alEUAMgx7HMegOmX@thinkstation> (raw)
In-Reply-To: <20260708170330.83850-1-yilun.xu@linux.intel.com>
On Thu, Jul 09, 2026 at 01:03:30AM +0800, Xu Yilun wrote:
> SEAMCALL invokes TDX module functions using a function number and
> parameters. To extend the functionalities of existing SEAMCALLs while
> keeping backward compatibility, TDX adds more numbered SEAMCALLs of the
> same family. This is just like syscalls, except that TDX defines a
> specific function number encoding pattern: a base function number and a
> version together encode the full function number.
>
> An existing SEAMCALL helper (TDH.VP.INIT) is already using the version
> field. Having the caller pack the version into the function number
> open-codes the ABI layout.
>
> Add a version field in struct tdx_module_args [1], so that most existing
> SEAMCALL helpers get a default "version == 0" behavior without code
> churn, while callers requiring extended functionalities can specify the
> version descriptively. Encode the tdx_module_args.version in the
> function number before calling into assembly code.
The commit message covers the mechanics, but is silent on compatibility
with older TDX modules. That context matters for the design choice, so
regardless of where the implementation discussion lands, I think it
needs to be spelled out here.
Who is responsible for picking a version the module supports?
TDH.VP.INIT can hardcode version 1 only because KVM already refuses to
enable TDX on modules without TOPOLOGY_ENUM.
The TDH.SYS.UPDATE user from [1] is the opposite case: it has to pick
version 0 or 1 at runtime depending on whether add-on features are
configured, to keep working on modules that don't support them.
The second point is the actual argument for a version field in struct
tdx_module_args rather than encoding the version in the leaf defines:
the version is not always a compile-time property of the call site.
Without TDH.SYS.UPDATE context, the patch seems pointless.
> Link: https://lore.kernel.org/kvm/4f4b0f29-424b-45ed-8cfd-c77da2ea390f@intel.com/ # [1]
--
Kiryl Shutsemau / Kirill A. Shutemov
prev parent reply other threads:[~2026-07-10 15:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 17:03 [PATCH v2] x86/virt/tdx: Formalize SEAMCALL version encoding support Xu Yilun
2026-07-08 18:03 ` Dave Hansen
2026-07-09 10:16 ` Xu Yilun
2026-07-10 16:21 ` Kiryl Shutsemau
2026-07-10 16:48 ` Dave Hansen
2026-07-10 15:56 ` Kiryl Shutsemau [this message]
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=alEUAMgx7HMegOmX@thinkstation \
--to=kas@kernel.org \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=djbw@kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.fang@intel.com \
--cc=rick.p.edgecombe@intel.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--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