From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.19 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796187320; b=OFjowmD9YTIPs0Me/cb0SfH4jeBdwnAU9yDQ6Dod2fFY9Fwl3OOfSSRhMmai3FEHITbs J9c+3oDShVkWPQoiBWkZBJuBeV3DiymEoxHKA/+ZpGOHFx6OBW0nkv6xQbQmyURQlPU9h IUiEsqg96bpXBCKOHNgVmtzDWxORLbs4oPCvvOy/cwCnnga9sOBx06wG+L611BLyPljcc jrDlUSQzoh+XhSMptZ6nYWJLHrXwvbQPNKDmA6Gct3H2Hi74AzXX+aCiSnooFTTH98zEo uCEMEJMuqi/F4N7ElwE5xHctEZ2HjOnEWbnfcXsJjHCMBo7n7p2CpdJETSCwLomp+xQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796187320; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:Subject:Date: Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding: X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature: X-Developer-Key; bh=P+ODI/WC+egTh0eci7Nu0d94t3pL5SITTT1EAgY6MZg=; b=wZqCozJVD2kyi8dDVGRwpEzM+7KdZkjxi3rmhSSbqAhBq9KpziUD7HMVL5mX14gvIOXd qKptp0poJdAPb6vRhGirqxhh5deiJk6BWjPNmbmsrQF55zsh0bfNZuK1u1C3VXcJwmSNy sxMJ5R5zZEWr7qiUcfCo7RjQJ3+/EDGEyESpepnK4h5VOvSZwCbeIdlRLPievI79P0GQK d6sXExy9Cd8bczGki4eGBb7mMHKyLO+i/K9T84SgmD/KpiHv4eMzW1l7exg+JMq87ZE8q C42n2MQ9i1O46KsNcCgxbANLA1rH1IDTFs9/oBApOA6+uxV+d6jNA7j2ii8QOm5rOAQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KDQzUNik; arc=none smtp.remote-ip=192.198.163.19 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25779606A322; Wed, 2 Dec 2026 04:55:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 25779606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KDQzUNik DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796187319; x=1827723319; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=P+ODI/WC+egTh0eci7Nu0d94t3pL5SITTT1EAgY6MZg=; b=KDQzUNiksYAsIVG0QXGHCorrMG8YafiOV+OfW4fFTsL7MhLl/qu588ty Gqym+eMDQzSj2hUfaEYQP/hF5HfLfbRMn7n3T4HWkpL4MS005jUdjAg8j FMFsq7BA3elbHEgh0+LlXgp7DXiPBlKjnY6IEceVUiM0nqc9LyInj7Nf1 yUGbapTIWXIzy1AI3Ybp8cqhztUpTbYUTFK+OIbbrS1f9Ve/bg+JOQZzN yYY1pBpOVzCEFgdwzA+IqyGbgJD3/CAR4Welr+KOQdZysYijb9y0KFcJ4 yPPjSCGuiIirZF/XY/ufURUXG8/rHzayXekre8ZqJORA4cojHIPnpSjD6 Q==; X-CSE-ConnectionGUID: 3z0JqPsvQ2uDV1w9/yV2qg== X-CSE-MsgGUID: IiPRaf/4SD2/vpz4qT2tQg== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5108469" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5108469" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 20:55:19 -0800 X-CSE-ConnectionGUID: ig+1biOBRku1Gu/geY5CMA== X-CSE-MsgGUID: /sn8ugkES2ShbuiPDx0Zbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13411175" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO [127.0.1.1]) ([10.239.47.46]) by orviesa002.jf.intel.com with ESMTP; 01 Dec 2026 20:55:14 -0800 From: Xu Yilun Subject: [PATCH v6 0/6] Enable TDX module extensions Date: Wed, 02 Dec 2026 12:43:24 +0800 Message-Id: <20261202-tdx-module-ext-v6-0-f6d8510fe498@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAOyhD2sC/23PSWrEMBAF0Ks0WkdGs+Ssco+QhYZSWuChI8vGT eO7R3YCaXBqU3yEHr8eaIKcYEKvlwfKsKQpjUMN6uWC/NUOn4BTqBkxwhRpqcIlrLgfw9wBhrX gYGnLSeTcE4Hqp1uGmNYDfP+oOeaxx+WawT4zktYtTaMpJ7rFFN9TNw/NOr91aZjXJg0FusaP/ S+Z4Wuu1cqPi5ydANfXPpVaVTEDOgivHJPeBGoi5UICt4wERg1rrQUNAu11rmkqY74f5y78wPZ KlJDTZQvHBAcnmXdEupaaU7cdXMQTQvkJETsCMkbrlRSa/I/IP6TOCZEV8VpErYR1noczsm3bN 6zGjHzLAQAA X-Change-ID: 20260916-tdx-module-ext-da1930f33c04 To: x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Kiryl Shutsemau , Rick Edgecombe , Dave Hansen , dave.hansen@intel.com, kvm@vger.kernel.org, yilun.xu@intel.com, yilun.xu@linux.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, artem.bityutskiy@linux.intel.com, nik.borisov@suse.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5243; i=yilun.xu@linux.intel.com; h=from:subject:message-id; bh=Hyw6wZqBtT3h2YBUMl7Qe4AvFGCY0Tki4ia3a53t+Ig=; b=owGbwMvMwCH2Zztz45IFPbcYT6slMWTzL1I67zN564moR4trp9XpbN6+bI3m7/D1du5/A1ZN+ SK1d5qKbkcnC4MYB4OhmCLLAo9ZTlPaZzFt/bTzGswcViaQIcIylZk5pXl6FaUOmXklqTl6yfm5 DFycAjBVvGsYGX5GBkT9LxNgbbHP+mWUZMG48SrPh2K+FU/+PJp2JOKo7xqGfwarZON2tq0XZHJ 4Z5qZ4qXQLX5J/uHMI1UBX1d0VwT+YgQA X-Developer-Key: i=yilun.xu@linux.intel.com; a=openpgp; fpr=A612D44FA98BA699FECC642BE2C8D72186AC3949 Hi, In this version, the DPAMT support patch is replaced by a new patch (Patch 4), so it needs more review from TDX developers/reviewers. I also refactored changelog for all patches according to review comments, the RBs are kept, please speak out if you object. If these patches (especially Patch 1 & 4) get good reviews and no major concern, Dave, please help take a look. Otherwise, feel free to ignore. == Changes == We had an internal discussion about the DPAMT support for new features. The TDX patch series are always too big to merge quickly and DPAMT support makes them even bigger. So the direction is to make the initial implementation of the new features simple by ignoring DPAMT. Drop the previous DPAMT support patch by a new one (Patch 4) that disables all add-on features when DPAMT is on. In this case, the extensions will be inactive and no DPAMT missing error is possible. Rick wondered if we really need an pr_info() to show the memory usage for the TDX module extensions. Yilun said he doesn't have strong perference, but the print is good for us to keep monitoring how the memory grows, and decide if we need to revisit the "automatically enable whatever feature is supported" policy. The print is kept in this version. v5: https://lore.kernel.org/all/20261111-tdx-module-ext-v5-0-c74f764abc3d@linux.intel.com/ v4: https://lore.kernel.org/r/20261013-tdx-module-ext-v4-0-de5ffac65470@linux.intel.com v3: https://lore.kernel.org/r/20261006-tdx-module-ext-v3-0-db52cb05b918@linux.intel.com v2: https://lore.kernel.org/all/20260915102658.713079-1-yilun.xu@linux.intel.com/ v1: https://lore.kernel.org/all/20260821032920.256225-1-yilun.xu@linux.intel.com/ Quoting v2: https://lore.kernel.org/lkml/20260618081355.3253581-1-yilun.xu@linux.intel.com/ Quoting v1: https://lore.kernel.org/all/20260522034128.3144354-1-yilun.xu@linux.intel.com/ == Overview == To date, SEAMCALL execution must either complete quickly to avoid stalling the host, or yield quickly at pre-defined interrupt checkpoints. This is acceptable for the existing SEAMCALL leafs, which perform simple, bounded operations. However, some new features such as attestation and TD migration require higher level security protocols inside the TDX module, which cannot fit within that constraint. TDX solves this by making those operations inherently preemptible and resumable like OS tasks. TDX provides a separate SEAMCALL execution environment - the TDX module extensions - for those operations. This capability allows for higher-level SEAMCALL ABI design - like "create a DICE-based attestation quote". Several new features, such as DICE-based attestation, TDISP and TD migration, use SEAMCALL leafs backed by the TDX module extensions. The TDX module extensions need memory for their execution environment to serve these SEAMCALL leafs, so they need extra setup steps during TDX module initialization. The bulk of this series implements these setup steps. At runtime, the host invokes these SEAMCALL leafs just as normal ones - if interrupted, simply re-invoke the leaf to resume. For more information on TDX module extensions, please refer to [1]. [1] https://lore.kernel.org/lkml/20260618081355.3253581-1-yilun.xu@linux.intel.com/ == Branch stack == This is based on v7.4-rc1. You can find the full branch stack at [2]. The DICE part is in the full branch as an example for extensions. But it does not include the other DICE feedbacks. The full branch contains: This series: Patch 1~7: This series, including this cover-letter. Use case: Patch 8~N: The old DICE part as an example. [2] https://github.com/intel-staging/tdx/tree/tdx-module-ext == Test == We made agreement with TDX module team about some ABI changes, it involves TDH.EXT.INIT, TDH.SYS.UPDATE. This series is written against these unreleased changes. So we did 2 kinds of tests. 1. Add some workaround patches in kernel then test on existing TDX module & real HW. See the full branch listed in "Branch stack" section. 2. Customize the TDX module, mock the ABI change, run with the module in a simulated environment with virtual SEAM support, no real security in this environment. --- Xu Yilun (6): x86/virt/tdx: Move TDH.SYS.CONFIG operations into a wrapper x86/virt/tdx: Configure add-on features on TDX module init x86/virt/tdx: Add extra memory to TDX module for the extensions x86/virt/tdx: Don't enable any add-on feature when DPAMT is on x86/virt/tdx: Make TDX module initialize the extensions x86/virt/tdx: Re-initialize the extensions on runtime TDX module update arch/x86/include/asm/tdx.h | 1 + arch/x86/include/asm/tdx_global_metadata.h | 4 + arch/x86/virt/vmx/tdx/tdx.h | 2 + arch/x86/virt/vmx/tdx/tdx.c | 235 ++++++++++++++++++++++++++-- arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 14 ++ 5 files changed, 245 insertions(+), 11 deletions(-) --- base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 change-id: 20260916-tdx-module-ext-da1930f33c04 Best regards, -- Xu Yilun