From: Nikolay Borisov <nik.borisov@suse.com>
To: Xu Yilun <yilun.xu@linux.intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Cc: kas@kernel.org, rick.p.edgecombe@intel.com,
dave.hansen@intel.com, dave.hansen@linux.intel.com,
yilun.xu@intel.com, djbw@kernel.org, linux-coco@lists.linux.dev,
chao.gao@intel.com, peter.fang@intel.com, xiaoyao.li@intel.com
Subject: Re: [PATCH v3] x86/virt/tdx: Formalize SEAMCALL version encoding support
Date: Thu, 23 Jul 2026 12:35:20 +0300 [thread overview]
Message-ID: <d21d1be4-1018-4bfa-9568-50f4630f0a2b@suse.com> (raw)
In-Reply-To: <20260722084634.131020-1-yilun.xu@linux.intel.com>
On 7/22/26 11:46, Xu Yilun wrote:
> SEAMCALL invokes TDX module functions using a function number and
> parameters. To extend the functionality 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.
>
> One concern is the compatibility with older TDX modules which don't
> recognize the new SEAMCALLs. The kernel should decide which SEAMCALL
> version to use at runtime, selecting the minimum version number for the
> required functionality. It can't overwrite the function number with a
> new value at compile time.
>
> Another concern is the obscure usage of the 'fn' parameter for SEAMCALL
> wrappers. An existing caller for TDH.VP.INIT packs the version into the
> 'fn' to match the low-level TDX ABI RAX layout. The RAX layout
> interprets some bits differently, such as INTERRUPT_MODE, SEAMLDR flag,
> which are not a good fit for the function number definition.
>
> Refactor the SEAMCALL wrappers to allow for version selection. Add a
> version field in struct tdx_module_args [1], so that most existing
> callers get a default "version == 0" behavior without code churn, while
> callers requiring extended functionalities can specify the version
> descriptively. Enforce the 'fn' parameter as the base function number.
> Encode the base function number and tdx_module_args.version in RAX
> before invoking the SEAMCALL instruction in assembly code.
>
> Link: https://lore.kernel.org/kvm/4f4b0f29-424b-45ed-8cfd-c77da2ea390f@intel.com/ # [1]
> Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
> ---
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
next prev parent reply other threads:[~2026-07-23 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 8:46 Xu Yilun
2026-07-22 11:23 ` Kiryl Shutsemau
2026-07-23 5:43 ` Xu Yilun
2026-07-23 9:35 ` Nikolay Borisov [this message]
2026-07-23 18:13 ` Edgecombe, Rick P
2026-07-24 3:14 ` Xu Yilun
2026-07-24 17:05 ` Edgecombe, Rick P
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=d21d1be4-1018-4bfa-9568-50f4630f0a2b@suse.com \
--to=nik.borisov@suse.com \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=djbw@kernel.org \
--cc=kas@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
Powered by JetHome