From nobody Mon Jun 8 20:41:43 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 C51EB37B3F9; Tue, 26 May 2026 15:43:53 +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=1779810235; cv=none; b=Q4ia4wI8rFKAurHkRxJmXlLEUFgLyG+sBSkqfK9myLFCLeGqSl5YcxiVLD5yyd+YWzKb02ZhvQblLqTYFUkg5PesUJDceGpRzu0SAOXpMY75MLB/GpU2Q9PQcSKCdDE9hoLAih0wkOzEEJjcxaRGsfGXw4aQHqazwrnMLPdCmCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779810235; c=relaxed/simple; bh=lLRDoroS34wtSC5MA290lzEnNAsFoDekI6f6XGGJYB0=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=cbudwB1zGMO1mrlpBngoOe0z0UCuW1diBUwIVuANbA4L6dkLfGmDXsjFnLWvs3sYhMJRPc31Z66NfA8YMZKAKV6TjxyJVRKeaEsDOETpr+s3j+86WeJlMPxmAgZyuTLBGvR4+y+DeQbReJv9HJPNgaVrlxIYwbF5Aux+L1L7Kcc= 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=AAALvNVZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WZhB/aI2; 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="AAALvNVZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WZhB/aI2" Date: Tue, 26 May 2026 15:43:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779810232; 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=+wVxDyjQy2CcVBoC7ykUkAyzF0itXHw0eejje15SfQo=; b=AAALvNVZvNMRYcbGuqOJeaOLWPW4kcI0UjgIFXguJM/oJcnOk5EzxljHz7z2Stsv6hlFfG EjRoJK0LwbH/TgPGyh6lmCFjUEjopxvQkTNIj51j3ncaSszao8v4EYxPi/tEiTynQH+hIc 8jB+v+ABbvNaPgh/Iv2ECZRlzqKlfV6DX6a4IH5APxdePpOPwYr/P7XpGlc5lhLDWajdjK BweU5bfGI3i8D9rSVj+RLvFZeq+/TNCbzV8bKU5jTtqDsEd6tAdZCsae4ZtC+mFqw5WyqO LD7vVdGa3f4IXQQOhlgc80BkKApGYRw5+ztWUe9jsx5GURsLdZTevmIFhteUcA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779810232; 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=+wVxDyjQy2CcVBoC7ykUkAyzF0itXHw0eejje15SfQo=; b=WZhB/aI2yWNh77bexYwxRI3Uz9Ae9nmtzDaTqCP/5MfOZd4rxSjAvok3kcjzx+vN3I2zfA lRt39CiuZypQZ6Ag== 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/tdx: Refresh TDX module version after update Cc: Chao Gao , Dave Hansen , Rick Edgecombe , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260520222912.75D9589C@davehans-spike.ostc.intel.com> References: <20260520222912.75D9589C@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: <177981023086.1039918.11166370253741331561.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: 73be1bb72f4ce52191767a1f59f6a6ac9ef3d7fb Gitweb: https://git.kernel.org/tip/73be1bb72f4ce52191767a1f59f6a6ac9= ef3d7fb Author: Chao Gao AuthorDate: Wed, 20 May 2026 15:29:12 -07:00 Committer: Dave Hansen CommitterDate: Tue, 26 May 2026 08:41:51 -07:00 x86/virt/tdx: Refresh TDX module version after update The kernel exposes the TDX module version through sysfs so userspace can check update compatibility. That information needs to remain accurate across runtime updates. A runtime update may change the module's update_version, so refresh the cached version right after a successful update. Drop __ro_after_init from tdx_sysinfo because it is now updated at runtime. Do not refresh the rest of tdx_sysinfo, even if some values change across updates. TDX module updates are backward compatible, so existing tdx_sysinfo consumers, such as KVM, can continue to operate without seeing the new values. [ dhansen: trim changelog ] Signed-off-by: Chao Gao Signed-off-by: Dave Hansen Reviewed-by: Rick Edgecombe Link: https://patch.msgid.link/20260520133909.409394-22-chao.gao@intel.com Link: https://patch.msgid.link/20260520222912.75D9589C@davehans-spike.ostc.= intel.com --- arch/x86/virt/vmx/tdx/tdx.c | 9 ++++++++- arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index d54c2ec..b15269b 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -67,7 +67,7 @@ static struct tdmr_info_list tdx_tdmr_list; /* All TDX-usable memory regions. Protected by mem_hotplug_lock. */ static LIST_HEAD(tdx_memlist); =20 -static struct tdx_sys_info tdx_sysinfo __ro_after_init; +static struct tdx_sys_info tdx_sysinfo; =20 static DEFINE_RAW_SPINLOCK(sysinit_lock); =20 @@ -1321,6 +1321,13 @@ int tdx_module_run_update(void) if (ret) return ret; =20 + ret =3D get_tdx_sys_info_version(&tdx_sysinfo.version); + /* + * Only fails if there is something unexpected + * and severely wrong with the module. + */ + WARN_ON_ONCE(ret); + tdx_module_state.initialized =3D true; return 0; } diff --git a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c b/arch/x86/virt/vm= x/tdx/tdx_global_metadata.c index e793dec..e49c300 100644 --- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c +++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c @@ -7,7 +7,7 @@ * Include this file to other C file instead. */ =20 -static __init int get_tdx_sys_info_version(struct tdx_sys_info_version *sy= sinfo_version) +static int get_tdx_sys_info_version(struct tdx_sys_info_version *sysinfo_v= ersion) { int ret =3D 0; u64 val;