From nobody Mon Jun 8 20:53:22 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 2324A3672BE; Tue, 26 May 2026 15:33:00 +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=1779809581; cv=none; b=BTr43/NrAPTDw+SJ6nV+XQ5wqV3g/PE4+pm7DsqMi5/clZBEbrzRjzh/8lEQLOlEb1zN/SYMdYremjG0M6SNRl10+yEz3XzQJOyN9M71TBVQ1Tev14zz+vsghZq6y5YYniFefcjSorUEkXsW6pyrljEQ9vaF3OogigR6tYFlsYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779809581; c=relaxed/simple; bh=saMytUPZFzWtMzWYfpIaBZbPLjigEjwPhQcTeQPsJeg=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=J1YTzTiWlfqzIbgV+MIuBRnGPzxHa+v23lGTMaxdDe3JCJPjJwHhDIcAYC05/fQKsun0PzWYeyfsJXvEEXh3T4biKdpfiLOP3aQCqkSYVlIjs/ffWa4SXsg2/ADu0UORQ4eTxw/n096Nc8HcNn20mZD6ylGhl02rZ03f2NOlgD0= 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=I2I/gupR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=k1aAnF8I; 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="I2I/gupR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="k1aAnF8I" Date: Tue, 26 May 2026 15:32:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779809578; 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; bh=TsVQSyTHMr44p5jwWOe9w7oi/5y8VFXvEPsGrzg2PTw=; b=I2I/gupRwEFmr8fjUIkxa6I39fq7kaV8j8DtcnZ2q1cZKC4hLytvcETaqQLWXrZcyc7MU4 emz1BCE7Azhh5ha/hLAQWmKNUEsEO8H6kzwgm0Yc6YwmSIh0PBSuJ8wBUfIRvXnwzZdIOF IpmMDuZVmMu5OaKo3xlzu8cBgUzgDmDD0groDHYYDLCiT9bkP//bl5lYy5ywuOG3daODGE aTcs017JNpET40A6Hz1Mx4nRodDHTObQrI6W5Fa9y/3sNIMMKaAxG1m1Fl1CNS0GGwad/v K69DWaG8JjP/D/ZUsTXFT+8KCZrgzZO85kRlMJj6y4YbPNze7g1UZ2x84/zKAw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779809578; 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; bh=TsVQSyTHMr44p5jwWOe9w7oi/5y8VFXvEPsGrzg2PTw=; b=k1aAnF8IpHMCDdtlEHFL8zK3eqQ5qTVyHelSsB2zFCSjyK5d5rq/Ago3xF29WPujgT1iG4 FvFJdMTcJx9/xJBA== From: "tip-bot2 for Dave Hansen" 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: Add module update locking Cc: Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177980957692.1039918.11642849352770901899.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: d34f37c3101c0364dba0d561e4911bc6496a2d0a Gitweb: https://git.kernel.org/tip/d34f37c3101c0364dba0d561e4911bc64= 96a2d0a Author: Dave Hansen AuthorDate: Fri, 22 May 2026 08:43:02 -07:00 Committer: Dave Hansen CommitterDate: Tue, 26 May 2026 08:29:15 -07:00 x86/virt/seamldr: Add module update locking TDX metadata like the version number changes during a module update. Add functions to lock out module updates. The current stop_machine() implementation uses worker threads. The scheduler actually does a full, normal context switch over to that thread. preempt_disable() obviously inhibits that context switch and thus, locks out stop_machine() users like the module update. Signed-off-by: Dave Hansen --- arch/x86/include/asm/seamldr.h | 2 ++ arch/x86/virt/vmx/tdx/seamldr.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/arch/x86/include/asm/seamldr.h b/arch/x86/include/asm/seamldr.h index 43084e2..cfc6a1b 100644 --- a/arch/x86/include/asm/seamldr.h +++ b/arch/x86/include/asm/seamldr.h @@ -32,5 +32,7 @@ static_assert(sizeof(struct seamldr_info) =3D=3D 256); =20 int seamldr_get_info(struct seamldr_info *seamldr_info); int seamldr_install_module(const u8 *data, u32 data_len); +void seamldr_lock_module_update(void); +void seamldr_unlock_module_update(void); =20 #endif /* _ASM_X86_SEAMLDR_H */ diff --git a/arch/x86/virt/vmx/tdx/seamldr.c b/arch/x86/virt/vmx/tdx/seamld= r.c index f5591d7..b1137ca 100644 --- a/arch/x86/virt/vmx/tdx/seamldr.c +++ b/arch/x86/virt/vmx/tdx/seamldr.c @@ -350,3 +350,19 @@ out: return ret; } EXPORT_SYMBOL_FOR_MODULES(seamldr_install_module, "tdx-host"); + +/* + * stop_machine() does not interrupt preemption-disabled regions. + * Simply disabling preempt prevents updates. + */ +void seamldr_lock_module_update(void) +{ + preempt_disable(); +} +EXPORT_SYMBOL_FOR_MODULES(seamldr_lock_module_update, "tdx-host"); + +void seamldr_unlock_module_update(void) +{ + preempt_enable(); +} +EXPORT_SYMBOL_FOR_MODULES(seamldr_unlock_module_update, "tdx-host");