From nobody Thu Apr 2 05:51:38 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 18A8937F75E; Mon, 30 Mar 2026 07:17:05 +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=1774855027; cv=none; b=UMdXIUvywuZpK4g8FykcaquOom0ZBi3krZcs60cKQIxOzZLohecQfEfpeMoMPWIlmX3T1nY+SygGOZCzWmLRAhu1V5gSB1gkfqVhX4EPvycB425FtuPWyrtTvyN2tNH3VrQRsHvpHZA94TMKClZaUq3e2RtAkMvsiVW1qUP/O1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774855027; c=relaxed/simple; bh=Rwi6yhngcowS1xvI82obudFmhRHoaBU1AX4i5WHSozI=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=aFDWI4QAzI8rIvkqS4UZwOaTBoBp41oU/aI/+WkqstL0oweg/LsTq0/bNFHivF8fcteaCNsJdTSjNCpuIOceDuewqTcgfytGx5gUmzONcxS0WIrX91Ie3jo7kKzFqkSbhwhSFm61ZrWm8hQcJ0aH0sJogtBCmPsS6gk96W8++G4= 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=WnQwuPlX; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5VO1/4V/; 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="WnQwuPlX"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5VO1/4V/" Date: Mon, 30 Mar 2026 07:17:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774855024; 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=Vlj2cnKKbOMuT6hKa6n/1D0B4+Yd+oR15Lt1dvAc09w=; b=WnQwuPlXIPmXUNetTeoxNtQONeAvSgkvcYf70zR9PCpzdOKmoJ47poXTgdKhBfK1aC/zXi sIbqhXSj004ZSujgO7/NpTj9bS1LnRhR0QMHCIVPv3Iw7lLWG3QVP6pU9A9oGdt/HSoEsf s55kbz1SM3Y/DHb7lox6PcOTOfHHn+ulediLao4wg2+v4sl3LWtRDez4e2YJYLBcfZPtQ3 tMsh0oUFXlyFmcH+kNRfeGW6M+njUeM4OgtBMxqwXIu471xbdtCo6z9YrKyJptyJeEulJ4 AhV4IuSYWRXv9a71K/d/CGUnqh+u3OtMCG8Gg4XkdAGGU1EEGDV8c7sqELqwlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774855024; 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=Vlj2cnKKbOMuT6hKa6n/1D0B4+Yd+oR15Lt1dvAc09w=; b=5VO1/4V/aCx9mpu7QI6USlKRnkWpVMwx+2Z/joi2CFQK640PagbYH6gqVkmXM6L6v/SSac YHp+A8qEOFNGezDQ== 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/fsgsbase: Remove unnecessary "memory" clobbers from FS/GS base (read-) accessors 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-1-ubizjak@gmail.com> References: <20260330055823.5793-1-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: <177485502311.1647592.17346726789976339622.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: d9576c9cd6a3056435e8e974c36ef576816a6c99 Gitweb: https://git.kernel.org/tip/d9576c9cd6a3056435e8e974c36ef5768= 16a6c99 Author: Uros Bizjak AuthorDate: Mon, 30 Mar 2026 07:57:42 +02:00 Committer: Ingo Molnar CommitterDate: Mon, 30 Mar 2026 09:10:15 +02:00 x86/asm/fsgsbase: Remove unnecessary "memory" clobbers from FS/GS base (rea= d-) accessors The rdfsbase() and rdgsbase() helpers currently include a "memory" clobber in their inline assembly definitions. However, the RDFSBASE and RDGSBASE instructions only read the FS/GS base MSRs into a general-purpose register and do not access memory. The "memory" clobber, which acts as a compiler barrier and may inhibit optimization, is therefore unnecessary. The "memory" clobber was historically used as a scheduling constraint to prevent the compiler from moving the instructions before preceding segment register loads. This is not required because both the segment register loads and the RDFSBASE/RDGSBASE accessors are implemented with `asm volatile`, which already prevents reordering between them. 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-1-ubizjak@gmail.com --- arch/x86/include/asm/fsgsbase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/fsgsbase.h b/arch/x86/include/asm/fsgsbas= e.h index ab2547f..70ff4ef 100644 --- a/arch/x86/include/asm/fsgsbase.h +++ b/arch/x86/include/asm/fsgsbase.h @@ -25,7 +25,7 @@ static __always_inline unsigned long rdfsbase(void) { unsigned long fsbase; =20 - asm volatile("rdfsbase %0" : "=3Dr" (fsbase) :: "memory"); + asm volatile("rdfsbase %0" : "=3Dr" (fsbase)); =20 return fsbase; } @@ -34,7 +34,7 @@ static __always_inline unsigned long rdgsbase(void) { unsigned long gsbase; =20 - asm volatile("rdgsbase %0" : "=3Dr" (gsbase) :: "memory"); + asm volatile("rdgsbase %0" : "=3Dr" (gsbase)); =20 return gsbase; }