Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
To: Xu Yilun <yilun.xu@linux.intel.com>,
	x86@kernel.org,  linux-coco@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: Kiryl Shutsemau <kas@kernel.org>,
	Rick Edgecombe	 <rick.p.edgecombe@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	 dave.hansen@intel.com, kvm@vger.kernel.org, yilun.xu@intel.com,
	 xiaoyao.li@intel.com, sohil.mehta@intel.com,
	adrian.hunter@intel.com,  kishen.maloor@intel.com,
	tony.lindgren@linux.intel.com, peter.fang@intel.com,
		baolu.lu@linux.intel.com, zhenzhong.duan@intel.com,
	chao.gao@intel.com, 	nik.borisov@suse.com
Subject: Re: [PATCH v5 2/6] x86/virt/tdx: Configure add-on features on TDX module init
Date: Sun, 22 Nov 2026 05:50:41 +0200	[thread overview]
Message-ID: <d012c58931efa38a782ac3484ea930d05a6407a9.camel@linux.intel.com> (raw)
In-Reply-To: <20261111-tdx-module-ext-v5-2-c74f764abc3d@linux.intel.com>

Hi Yilun,

The patch looks good, but its framing can be improved.

Remove references to enabling all add-ons to improve it. This patch adds
plumbing, it should not dictate/discuss whether all or only some add-ons
should be enabled. See comments below.

On Wed, 2026-11-11 at 11:48 +0800, Xu Yilun wrote:
> The TDX architecture identifies some features that are off by default.
> They are classified as add-on features because enabling them affects
> existing TDX systems: they may change existing feature behavior, or
> reserve more memory.
> 
> However, the impact of the first add-on features will be low enough to
> pursue a simple approach - the kernel just enables them when supported.
> If a feature with a very high overhead appears in the future, this can
> be revisited.

This sounds like all supported add-ons will be enabled for simplicity.

The reviewer keeps this in mind now.

... snip ...

> Pass the bitmap of features that are supported by both kernel & TDX
> module to TDH.SYS.CONFIG. Initially, the bitmap is 0. It will be updated
> to contain specific feature bits as full kernel support lands.

But this says that it enables no add-ons. Now reviewer needs to spend
brain cycles to process the contradiction, unnecessarily.

... snip ...

>  arch/x86/virt/vmx/tdx/tdx.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
> index c7bd0b01786d..3bfe78b4b538 100644
> --- a/arch/x86/virt/vmx/tdx/tdx.c
> +++ b/arch/x86/virt/vmx/tdx/tdx.c
> @@ -1033,9 +1033,19 @@ static __init int construct_tdmrs(struct list_head *tmb_list,
>  
>  #define TDX_SYS_CONFIG_DYNAMIC_PAMT	BIT(16)
>  
> +/* List all kernel-supported add-on features0 bits here */
> +#define TDX_KERNEL_SUPPORTED_ADDON_FEATURES0	(0)

Suggested comment:

/* Specify add-on feature bits to enable” instead */

I think that this patch should not dictate "all" vs "some", no need.

... snip ...

> +	/*
> +	 * Use SEAMCALL version 1 that supports add-on features if any are
> +	 * requested. Otherwise use version 0 for backward compatibility.
> +	 */
> +	if (addon_features0) {
> +		args.r9 = addon_features0;
> +		args.version = 1;
> +	}

Separate nitpick for the comment.

Suggested comment:

/*
 * Avoid unnecessarily requiring version 1 when no add-on features to
 * request.
 */

I was confused by "for backward compatibility”, which sounds like the
kernel or the seamcall falls back to version 0 if version 1 is not
supported.

Thanks, Artem.

  reply	other threads:[~2026-11-22  3:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  3:48 [PATCH v5 0/6] Enable TDX module extensions Xu Yilun
2026-11-11  3:48 ` [PATCH v5 1/6] x86/virt/tdx: Move TDH.SYS.CONFIG operations into a wrapper Xu Yilun
2026-11-13 15:06   ` Nikolay Borisov
2026-11-18 18:51   ` Edgecombe, Rick P
2026-11-19  3:31     ` Xu Yilun
2026-11-11  3:48 ` [PATCH v5 2/6] x86/virt/tdx: Configure add-on features on TDX module init Xu Yilun
2026-11-22  3:50   ` Artem Bityutskiy [this message]
2026-11-11  3:48 ` [PATCH v5 3/6] x86/virt/tdx: Add extra memory to TDX module for the extensions Xu Yilun
2026-11-17  3:06   ` Alexey Kardashevskiy
2026-11-18  2:32     ` Xu Yilun
2026-11-18 22:18   ` Edgecombe, Rick P
2026-11-19  4:50     ` Xu Yilun
2026-11-11  3:48 ` [PATCH v5 4/6] x86/virt/tdx: Support DPAMT when adding memory " Xu Yilun
2026-11-11  3:48 ` [PATCH v5 5/6] x86/virt/tdx: Make TDX module initialize " Xu Yilun
2026-11-13 16:13   ` Nikolay Borisov
2026-11-18 22:44   ` Edgecombe, Rick P
2026-11-19  5:20     ` Xu Yilun
2026-11-11  3:48 ` [PATCH v5 6/6] x86/virt/tdx: Re-initialize the extensions on runtime TDX module update Xu Yilun

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=d012c58931efa38a782ac3484ea930d05a6407a9.camel@linux.intel.com \
    --to=artem.bityutskiy@linux.intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kas@kernel.org \
    --cc=kishen.maloor@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nik.borisov@suse.com \
    --cc=peter.fang@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sohil.mehta@intel.com \
    --cc=tony.lindgren@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@linux.intel.com \
    --cc=zhenzhong.duan@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