From nobody Thu Apr 2 09:14:46 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 C286239FCA6; Mon, 30 Mar 2026 07:17:04 +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=1774855026; cv=none; b=tKCx0a9m9ZbK12p3R/OPYq/LgnqVso9ZfDh6gvofVJgIqVfqZbWfq3eKAHmUC1vG10hZ2xA6YoFRyU87Cy/gXhgAuxrXzzlWP+/kPu4q7ftE7Q+UErGLgUmVcRksWT146aJ8/R6CR1WFqlZHCgCzgYh/0upbnfnKFsOzls46KvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774855026; c=relaxed/simple; bh=kPpRzrR/RhfzDsV1BRf0AQVVB46L2vN6SSzeifH9aXs=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=XoMJYIbLy8gWV4fOS6Hz0aKlpckkYMlZuLYtS1R/LVM6vYW0MECGBIOorrZrdmBQMdoIeu3MQxqQSSXISFNCD9VidDLBqIII+utUn+x2RQnz3P3Z9X19IO4y2ThKCJu2ZLmhTFG2y+siIdp6p37xQpyIBNMr1N9Sbe/Fzctm+R0= 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=h8fR41dM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=psWyCQZc; 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="h8fR41dM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="psWyCQZc" Date: Mon, 30 Mar 2026 07:17:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774855023; 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=pSNTnHQknPHJn8P1E7T9dzouOl1Lz3PymPOnHpPv9ic=; b=h8fR41dMxJOLuLHbxu5OXkIWCOZEqR4NWdgHQgxoTvCMflFZLy6svK6SUV4/XRtOr4RrK4 mGUKrO9Fxzc5fSIxXkYyBJi/qbWY7aozI5lGKNP8HJWedwjR0AJdrwy2aQEDjMbxip3YZJ CeK4RABnhtzpOPdmih3e3vXNM2CV8KzE12dsGUugQVL+8KQpYedkSESAhBuDWzuA8FFAKF U/YdlnyjKtdCVvCbZkhEuBGk/RbHtiS1agW5o+15CFwjLO5dQLLMS4rPXXGoEIO3J3oV3U /nAI+4N6FOnLLyFbiWrPlCQefTFe2lEnQyZkhaTiRbk7w7rxZeX+5RhX8LNyIw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774855023; 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=pSNTnHQknPHJn8P1E7T9dzouOl1Lz3PymPOnHpPv9ic=; b=psWyCQZc7g/aNfSR4INaEn8/XcQ+siajlXJU0s1k55U1xGqJJdsHVglJOF+EiSnCAxR6ux Rg92n6JOjr+zpfDA== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/asm] x86/asm/segment: Remove unnecessary "memory" clobber from savesegment() Cc: Uros Bizjak , Ingo Molnar , "Peter Zijlstra (Intel)" , Linus Torvalds , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260330055823.5793-2-ubizjak@gmail.com> References: <20260330055823.5793-2-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177485502070.1647592.17856934209537323721.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/asm branch of tip: Commit-ID: 8379ca68a01c38485b620d36a72d8aeeca86e743 Gitweb: https://git.kernel.org/tip/8379ca68a01c38485b620d36a72d8aeec= a86e743 Author: Uros Bizjak AuthorDate: Mon, 30 Mar 2026 07:57:43 +02:00 Committer: Ingo Molnar CommitterDate: Mon, 30 Mar 2026 09:10:15 +02:00 x86/asm/segment: Remove unnecessary "memory" clobber from savesegment() The savesegment() macro uses inline assembly to copy a segment register into a general-purpose register: movl %seg, reg This instruction does not access memory, yet the inline asm currently declares a "memory" clobber, which unnecessarily acts as a compiler barrier and may inhibit optimization. Remove the "memory" clobber and mark the asm as `asm volatile` instead. Segment register loads in the kernel are implemented using `asm volatile`, so the compiler will not schedule segment register reads before those loads. Using `asm volatile` preserves the intended ordering with other segment register operations without imposing an unnecessary global memory barrier. No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: H. Peter Anvin Link: https://patch.msgid.link/20260330055823.5793-2-ubizjak@gmail.com --- arch/x86/include/asm/segment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 9f5be2b..3fe3a31 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -348,7 +348,7 @@ static inline void __loadsegment_fs(unsigned short valu= e) * Save a segment register away: */ #define savesegment(seg, value) \ - asm("movl %%" #seg ",%k0" : "=3Dr" (value) : : "memory") + asm volatile("movl %%" #seg ",%k0" : "=3Dr" (value)) =20 #endif /* !__ASSEMBLER__ */ #endif /* __KERNEL__ */