From nobody Sun May 24 19:34:48 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 13D2386329; Fri, 22 May 2026 17:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779470778; cv=none; b=UjHj9jATCYO4WP9PhvJTn7CNqlQL1uoXHLYE2o72Ot9nTx+LCt/a4qE4O5AtgxKWTyy2nlJal8iLVp+sxuT8CjBAsVTFykXWYC+BCPX57KnW84r4r4flD/rWREZgqVRVYfaksB6HUkCDrBe4IZYmpig8WHzvrmpCscq8s09o21Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779470778; c=relaxed/simple; bh=ezxiEPlBtsLBkL4L8XbUFghLUiT3bqJ8reSeMIFj7O4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=PtV88yQhwDrCh66j+uF28AZapC66zZ+dVZ7WqPX7PWxqX9mt/nfASVL9BRERMDVujKErnMdUokOT0UTGcvVDIC7uIXY+NB5Xfo1AKPSUAqVjXtCveUWQ3oN624+iOaIlnxn0Ex7xXlB1cuLO08qjTIVhRDQEci86m3eiJohetzw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D09wfJ+U; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LM/iiyZ4; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D09wfJ+U"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LM/iiyZ4" Date: Fri, 22 May 2026 17:26:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779470773; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dMK2KZsn8CcHWH/KW+doM3VDTRkkEPanD59Vxq8C/24=; b=D09wfJ+UdWpMrics7owy0HjHCDA7IOTosNc/Z7ZuCEmDam+nmKW3dmuwc76IFiC8OkJjpr ecjmOPjG3SWAGwH5XogCBF2xQd+GE34jHbywPtVG4nx8SQxJa4Ptkei7BKVpmaU1pPXtxD oKmamK+pmEtfVl/wAE9GsKqSihv75yiCFVEkf1mBbfAw+WLcjsW1dXpe3Vnngl21uEErr5 r/zal2a9viGr3/AY8wMJjCun7KsYM1SwDgcpGrTboBLiD0cVYIdC4v9HYRZVjGaotDWo3+ EdHZpyGdO8MbJ35jnbhNmd3pX8O1hGu+VEHA07v28ZQ/sZULQpxXeOVAkakNkw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779470773; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dMK2KZsn8CcHWH/KW+doM3VDTRkkEPanD59Vxq8C/24=; b=LM/iiyZ4pTViKAKj9mtlo6oB+wT7C6VBBoy7ogVM93MB+FLGZLdXeLjgU26C8qTeMk5YC3 z232cocjN+K/R7Dw== From: "tip-bot2 for Chao Gao" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/tdx] x86/virt/seamldr: Initialize the newly-installed TDX module Cc: Chao Gao , Dave Hansen , Xu Yilun , Tony Lindgren , Kai Huang , "Kiryl Shutsemau (Meta)" , Rick Edgecombe , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260520222909.466B929B@davehans-spike.ostc.intel.com> References: <20260520222909.466B929B@davehans-spike.ostc.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177947077186.711.8187784143552449267.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/tdx branch of tip: Commit-ID: ae1b7dc35a2309b5493eeb2e56275617f1de8e13 Gitweb: https://git.kernel.org/tip/ae1b7dc35a2309b5493eeb2e56275617f= 1de8e13 Author: Chao Gao AuthorDate: Wed, 20 May 2026 15:29:09 -07:00 Committer: Dave Hansen CommitterDate: Wed, 20 May 2026 15:37:11 -07:00 x86/virt/seamldr: Initialize the newly-installed TDX module Continue fleshing out the update process. At this point new the new module is installed but is not usable. It is in a similar state to the when the system first boots. TODO: this is nonsense. What is *MISSING*?!?!? >>>This post-update initialization differs from the initial boot-time >>>initialization. It only needs TDX global initialization, TDX per-CPU >>>initialization, and restoration of TDX state from the handoff data. After installing a new TDX module, the kernel must re-initialize TDX before resuming TDX operations. tdx_cpu_enable() covers the global and per-CPU initialization. Export it and invoke it on all CPUs. Signed-off-by: Chao Gao Signed-off-by: Dave Hansen Reviewed-by: Xu Yilun Reviewed-by: Tony Lindgren Reviewed-by: Kai Huang Reviewed-by: Kiryl Shutsemau (Meta) Reviewed-by: Rick Edgecombe Link: https://patch.msgid.link/20260520133909.409394-20-chao.gao@intel.com Link: https://patch.msgid.link/20260520222909.466B929B@davehans-spike.ostc.= intel.com --- arch/x86/include/asm/tdx.h | 1 + arch/x86/virt/vmx/tdx/seamldr.c | 4 ++++ arch/x86/virt/vmx/tdx/tdx.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h index 27376db..5d750fe 100644 --- a/arch/x86/include/asm/tdx.h +++ b/arch/x86/include/asm/tdx.h @@ -107,6 +107,7 @@ static inline long tdx_kvm_hypercall(unsigned int nr, u= nsigned long p1, =20 #ifdef CONFIG_INTEL_TDX_HOST void tdx_init(void); +int tdx_cpu_enable(void); const char *tdx_dump_mce_info(struct mce *m); const struct tdx_sys_info *tdx_get_sysinfo(void); =20 diff --git a/arch/x86/virt/vmx/tdx/seamldr.c b/arch/x86/virt/vmx/tdx/seamld= r.c index 54fa797..5fdb36b 100644 --- a/arch/x86/virt/vmx/tdx/seamldr.c +++ b/arch/x86/virt/vmx/tdx/seamldr.c @@ -209,6 +209,7 @@ enum module_update_state { MODULE_UPDATE_START, MODULE_UPDATE_SHUTDOWN, MODULE_UPDATE_CPU_INSTALL, + MODULE_UPDATE_CPU_INIT, MODULE_UPDATE_DONE, }; =20 @@ -287,6 +288,9 @@ static int do_seamldr_install_module(void *seamldr_para= ms) case MODULE_UPDATE_CPU_INSTALL: ret =3D seamldr_install(seamldr_params); break; + case MODULE_UPDATE_CPU_INIT: + ret =3D tdx_cpu_enable(); + break; default: break; } diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index 37e52cd..080a2bc 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -113,7 +113,7 @@ out: * (and TDX module global initialization SEAMCALL if not done) on local cp= u to * make this cpu be ready to run any other SEAMCALLs. */ -static int tdx_cpu_enable(void) +int tdx_cpu_enable(void) { struct tdx_module_args args =3D {}; int ret;