From nobody Sat Feb 7 08:27:14 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DB98352FB7; Fri, 23 Jan 2026 15:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180440; cv=none; b=i3csu5q1VndLBopiksf20/uGHD1qWof2mT8+REHBBdPyTDgwfeSPrlPdDhFKx2EnaUR0Oysoxpsg2/eFernJqCi/57aJQj+B8x9mUqJ1UHpKU2uRcHvk0ZLvBgDMX0P1sjsdcsV/ZvQG/+xVE9i1c+/iN58FICMkLQbUz5nPNx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180440; c=relaxed/simple; bh=0g+/1AW3re/sy+yiWP4UxxTqPhaUBDy59R1dOAb9GAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P86NI/fqcD3SSoS1xymJWQXxf5JiThk1JCe44fbSycx6zWT8gvZ70SZKT40tEKL6p7KkJpzlFbfqaWQ2ypyFqHm3ESaP8pxldk7UgytF4GiO5fWdQEKDk1DKIhLZ1E8KCy3SdnjASGMUyDPCWUxcmvOXK/9uG3lmeXVNHl6Nxfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dwIy6eoU; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dwIy6eoU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769180438; x=1800716438; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0g+/1AW3re/sy+yiWP4UxxTqPhaUBDy59R1dOAb9GAk=; b=dwIy6eoUjfJHNs6GFRxlxoIkUBkIBaN4TgmYJ6NenLkDjUz4gcqnBBb+ 9Hp9dNR6WgvuztU5jf/ZlkZsZoWMTfAV1r7FEix9i9QmupbryTKOfDSlZ mY0yl2IS1loSfjbj0pXWxMuWp62bVYVJBPj3f30C5mQI0s2CRxoQPVnf2 RO9scH4OHAw/gjgxOytjuCHpZ3SEHNYt6zK+uZPFgHwJ4T3VqvwtnyE4c CRpvRwflADhfpYlMijyigrChQqKVFiLbWdFhN7g+CaBIgLAwW/jpDgcDP gcrO63S7MKsJNn6ZHVSVM1hH29jvwOgjwaF7etAiqCJXSTqiXdokpqXTQ Q==; X-CSE-ConnectionGUID: VCYau2RuRu6sRZxq+surYQ== X-CSE-MsgGUID: MzR3ZRDEToWjebf7auh5FQ== X-IronPort-AV: E=McAfee;i="6800,10657,11680"; a="70334525" X-IronPort-AV: E=Sophos;i="6.21,248,1763452800"; d="scan'208";a="70334525" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2026 07:00:20 -0800 X-CSE-ConnectionGUID: EpxuqmBOQBue2WoSpWetfA== X-CSE-MsgGUID: 2ZrjhY+nQ7WJQjRSTzqStQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,248,1763452800"; d="scan'208";a="237697216" Received: from 984fee019967.jf.intel.com ([10.23.153.244]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2026 07:00:20 -0800 From: Chao Gao To: linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org Cc: reinette.chatre@intel.com, ira.weiny@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, yilun.xu@linux.intel.com, sagis@google.com, vannapurve@google.com, paulmck@kernel.org, nik.borisov@suse.com, zhenzhong.duan@intel.com, seanjc@google.com, rick.p.edgecombe@intel.com, kas@kernel.org, dave.hansen@linux.intel.com, vishal.l.verma@intel.com, Chao Gao , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v3 23/26] x86/virt/tdx: Enable TDX Module runtime updates Date: Fri, 23 Jan 2026 06:55:31 -0800 Message-ID: <20260123145645.90444-24-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260123145645.90444-1-chao.gao@intel.com> References: <20260123145645.90444-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" All pieces of TDX Module runtime updates are in place. Enable it if it is supported. Signed-off-by: Chao Gao Reviewed-by: Tony Lindgren Reviewed-by: Xu Yilun --- arch/x86/include/asm/tdx.h | 5 ++++- arch/x86/virt/vmx/tdx/tdx.h | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h index ffadbf64d0c1..0cd408f902f4 100644 --- a/arch/x86/include/asm/tdx.h +++ b/arch/x86/include/asm/tdx.h @@ -32,6 +32,9 @@ #define TDX_SUCCESS 0ULL #define TDX_RND_NO_ENTROPY 0x8000020300000000ULL =20 +/* Bit definitions of TDX_FEATURES0 metadata field */ +#define TDX_FEATURES0_TD_PRESERVING BIT(1) +#define TDX_FEATURES0_NO_RBP_MOD BIT(18) #ifndef __ASSEMBLER__ =20 #include @@ -105,7 +108,7 @@ const struct tdx_sys_info *tdx_get_sysinfo(void); =20 static inline bool tdx_supports_runtime_update(const struct tdx_sys_info *= sysinfo) { - return false; /* To be enabled when kernel is ready */ + return sysinfo->features.tdx_features0 & TDX_FEATURES0_TD_PRESERVING; } =20 int tdx_guest_keyid_alloc(void); diff --git a/arch/x86/virt/vmx/tdx/tdx.h b/arch/x86/virt/vmx/tdx/tdx.h index d1807a476d3b..749f4d74cb2c 100644 --- a/arch/x86/virt/vmx/tdx/tdx.h +++ b/arch/x86/virt/vmx/tdx/tdx.h @@ -88,9 +88,6 @@ struct tdmr_info { DECLARE_FLEX_ARRAY(struct tdmr_reserved_area, reserved_areas); } __packed __aligned(TDMR_INFO_ALIGNMENT); =20 -/* Bit definitions of TDX_FEATURES0 metadata field */ -#define TDX_FEATURES0_NO_RBP_MOD BIT(18) - /* * Do not put any hardware-defined TDX structure representations below * this comment! --=20 2.47.3