From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 2CA6C36CE05 for ; Sun, 15 Mar 2026 13:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773583194; cv=none; b=pP+Tr/uFIXHTtghgBq+SS/YJefX6LJZhS4yNZRVCNhz3a/FMAzbY18TslfltJYafQouJoLlob8huDr4hRUwPbWKg8AI2MBPIVxr4zEXaYSYtOnSD5Mz18w+DdGGNTi+wL0VImIhTJ39/ndJZWayND8Z57vp31yFQ4nXTzGnwJGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773583194; c=relaxed/simple; bh=lS5h9Kr8Hw4PlPxrBW5fZQ5sCJHX/djsuyeiSlkQS6s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uDK4ED0XZjmAM1WnUR0oeRGr4+clSSKKkbxjq4GqSnhykpbjsw+TjWs/53TEn4+K/LiIsx/RsGfeAJcQU54MwSA65BURjEdnPlyYGaDzFUgA3oGGMPqTkmizx2DsebaYRTysxGHyww6tvScXBTh263ImKRpSlqj+kyop+vzhQwo= 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=LdGpw17A; arc=none smtp.client-ip=192.198.163.15 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="LdGpw17A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1773583192; x=1805119192; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lS5h9Kr8Hw4PlPxrBW5fZQ5sCJHX/djsuyeiSlkQS6s=; b=LdGpw17AwAF1AkyTOpanqY2p2RPedRFqU2VE6cncFVYhT/5tU7Gth0YU lTzAwHoxHJmDQ9oHY71irilCiytDwQxC2Uta2/4uCQrk18ReLLhEzjAtv cbMEXwGY7XcVDaEsc7RC94wqgP+0cVf/NAyaHJZPQtyr/4YcGRznzVjkY HFMYsGilsal0h4+EdMrDVGe5yeVJgMq8QU231RJWZwsmqms54uSHMbzvF Vu7AfXDQ2Z+prWniFtpa41bZwNQNIWP5ykvNQGZz2B0uf2YhZdgUWUIfO 77nO1GTQxoY5nJnRRqU9XXT+EeVWKp7wQO3YtMbQ/fK3wRhxMq7zH+cnl g==; X-CSE-ConnectionGUID: Tc0aQL3ZQEm7MTX2gNxQeg== X-CSE-MsgGUID: Pf0Cv26SQOCo9gMLOsYOrg== X-IronPort-AV: E=McAfee;i="6800,10657,11730"; a="74732574" X-IronPort-AV: E=Sophos;i="6.23,122,1770624000"; d="scan'208";a="74732574" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2026 06:59:46 -0700 X-CSE-ConnectionGUID: u20j5D/XS0OuA2jry8JNxA== X-CSE-MsgGUID: r9qqBnKfQ9iPruNxn5RNcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,122,1770624000"; d="scan'208";a="226123090" Received: from 984fee019967.jf.intel.com ([10.23.153.244]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2026 06:59:46 -0700 From: Chao Gao To: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org Cc: binbin.wu@linux.intel.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, kai.huang@intel.com, kas@kernel.org, nik.borisov@suse.com, paulmck@kernel.org, pbonzini@redhat.com, reinette.chatre@intel.com, rick.p.edgecombe@intel.com, sagis@google.com, seanjc@google.com, tony.lindgren@linux.intel.com, vannapurve@google.com, vishal.l.verma@intel.com, yilun.xu@linux.intel.com, Chao Gao , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Jonathan Corbet , Shuah Khan Subject: [PATCH v5 21/22] x86/virt/tdx: Document TDX module update Date: Sun, 15 Mar 2026 06:58:41 -0700 Message-ID: <20260315135920.354657-22-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315135920.354657-1-chao.gao@intel.com> References: <20260315135920.354657-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Document TDX module update as a subsection of "TDX Host Kernel Support" to provide background information and cover key points that developers and users may need to know, for example: - update is done in stop_machine() context - update instructions and results - update policy and tooling Signed-off-by: Chao Gao Reviewed-by: Kai Huang --- v5: - use "update" when refer to the update feature/concept [Kai] --- Documentation/arch/x86/tdx.rst | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/arch/x86/tdx.rst b/Documentation/arch/x86/tdx.rst index 61670e7df2f7..d4e257542d4c 100644 --- a/Documentation/arch/x86/tdx.rst +++ b/Documentation/arch/x86/tdx.rst @@ -99,6 +99,42 @@ initialize:: [..] virt/tdx: module initialization failed ... +TDX module Runtime Update +------------------------- + +The TDX architecture includes a persistent SEAM loader (P-SEAMLDR) that +runs in SEAM mode separately from the TDX module. The kernel can +communicate with P-SEAMLDR to perform runtime updates of the TDX module. + +During update, the TDX module becomes unresponsive to other TDX operations. +To prevent components using TDX (such as KVM) from experiencing unexpected +errors during updates, updates are performed in stop_machine() context. + +TDX module update has complex compatibility requirements; the new module +must be compatible with the current CPU, P-SEAMLDR, and running TDX module. +Rather than implementing complex module selection and policy enforcement +logic in the kernel, userspace is responsible for auditing and selecting +appropriate updates. + +Updates use the standard firmware upload interface. See +Documentation/driver-api/firmware/fw_upload.rst for detailed instructions + +Successful updates are logged in dmesg: + [..] virt/tdx: version 1.5.20 -> 1.5.24 + +If updates failed, running TDs may be killed and further TDX operations may +be not possible until reboot. For detailed error information, see +Documentation/ABI/testing/sysfs-devices-faux-tdx-host. + +Given the risk of losing existing TDs, userspace should verify that the +update is compatible with the current system and properly validated before +applying it. + +A reference userspace tool that implements necessary checks is available +at: + + https://github.com/intel/tdx-module-binaries + TDX Interaction to Other Kernel Components ------------------------------------------ -- 2.47.3