From nobody Fri Dec 19 11:17:07 2025 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 2AA891946C3; Sat, 12 Apr 2025 18:47: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=1744483622; cv=none; b=VKQfSgZgRQy7eevzlSEJdOD3p8hsAdjVCZ+fA9ENPgIWXU4XU/e8jHcWTTYewWjQNAWtpLYtls4DkKsc/LnsDvty6VBq75SAPsXgvWDgdLQWAYpIfh10j7D5izoIGOA0PC+cJGOEE+P08a5iERJ1tpPY915RvINNPlPs4TtXH54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744483622; c=relaxed/simple; bh=m/r7xJocCTypfe5v7VFoabjBRX+dOQVSexCswWiliwo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=JEBI6lbCG21byST7YPzS5soFOAwRZcLg8Lyw71r3GlXBG2wXr9nFtk13Rg6mdxjQVYgLyeOqHOlUp1ifQHvDDq91fkZMX9KvRPwMGZ5Y6u0fELf95IxN0gGSi0qshck9vRCntZKbAHrUBGVSrvvqowaMAD7ZbllCTX7T2KXa2XI= 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=aLNAW8fG; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3sBI/6+q; 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="aLNAW8fG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3sBI/6+q" Date: Sat, 12 Apr 2025 18:46:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1744483619; 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=bladjb1LTgG9dmSCq75/GKUNxkgnMNGRhPPfXGUgW/g=; b=aLNAW8fGDqIKlKrsTJh5frYX35oYGWt8l088zwgllIsGO1zuCzHHtMiCM/vFDzTrTKhQf9 Y0xr3TBUPpJafEkk/nxBgktICaW6l65i8Mw6gEbSAkX5EG9phs6r6hLJqZkcJ42j8LCikF Vupg8cDj5cxAMzO26L5AAYTtYaVEWq5IutzjzIthOKlCmuNoce1ig/5xewE5qt0edFLAA2 CA+cHeCiaQxsJSvANXDtEE4JgF1FYLI3Y6bpBK6ERXSvWxMHT/pEN+yeT919p+Q7iMxkOa DeLH2mVlezE1x2CzSO3WyEp/UX8Wp14w+NcKwZhkotE6gpcQ11RR+MS2KE7mYg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1744483619; 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=bladjb1LTgG9dmSCq75/GKUNxkgnMNGRhPPfXGUgW/g=; b=3sBI/6+qY77SmzIyBIVZzSXfVK51abSxDYRlYLzV3MPUHfWlKh6iA4u1gAG/rc+YXpQHjU pykBSYxQURZkCQCw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/alternatives] x86/mm: Add 'mm' argument to unuse_temporary_mm() Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Andy Lutomirski , Rik van Riel , "H. Peter Anvin" , Linus Torvalds , Andrew Morton , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250402094540.3586683-2-mingo@kernel.org> References: <20250402094540.3586683-2-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174448361858.31282.17438170257823351536.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/alternatives branch of ti= p: Commit-ID: 0812e096cff0fd58d88a21a413fba56c0e6c3caa Gitweb: https://git.kernel.org/tip/0812e096cff0fd58d88a21a413fba56c0= e6c3caa Author: Peter Zijlstra AuthorDate: Wed, 02 Apr 2025 11:45:34 +02:00 Committer: Ingo Molnar CommitterDate: Sat, 12 Apr 2025 10:05:37 +02:00 x86/mm: Add 'mm' argument to unuse_temporary_mm() In commit 209954cbc7d0 ("x86/mm/tlb: Update mm_cpumask lazily") unuse_temporary_mm() grew the assumption that it gets used on poking_mm exclusively. While this is currently true, lets not hard code this assumption. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Rik van Riel Cc: "H. Peter Anvin" Cc: Linus Torvalds Cc: Andrew Morton Link: https://lore.kernel.org/r/20250402094540.3586683-2-mingo@kernel.org --- arch/x86/kernel/alternative.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index f785d23..95053e8 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -2161,14 +2161,14 @@ static inline struct mm_struct *use_temporary_mm(st= ruct mm_struct *temp_mm) __ro_after_init struct mm_struct *text_poke_mm; __ro_after_init unsigned long text_poke_mm_addr; =20 -static inline void unuse_temporary_mm(struct mm_struct *prev_mm) +static inline void unuse_temporary_mm(struct mm_struct *mm, struct mm_stru= ct *prev_mm) { lockdep_assert_irqs_disabled(); =20 switch_mm_irqs_off(NULL, prev_mm, current); =20 /* Clear the cpumask, to indicate no TLB flushing is needed anywhere */ - cpumask_clear_cpu(raw_smp_processor_id(), mm_cpumask(text_poke_mm)); + cpumask_clear_cpu(raw_smp_processor_id(), mm_cpumask(mm)); =20 /* * Restore the breakpoints if they were disabled before the temporary mm @@ -2275,7 +2275,7 @@ static void *__text_poke(text_poke_f func, void *addr= , const void *src, size_t l * instruction that already allows the core to see the updated version. * Xen-PV is assumed to serialize execution in a similar manner. */ - unuse_temporary_mm(prev_mm); + unuse_temporary_mm(text_poke_mm, prev_mm); =20 /* * Flushing the TLB might involve IPIs, which would require enabled