From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 72589347FE6 for ; Thu, 18 Dec 2025 10:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766053385; cv=none; b=EakdVmlBTHBoyy1nnCOMQc1vZkRxiA+Tp2XooVyyzd8psBfKZeQ36qZGk02jfGjw0xNNrd01/ETK6KkuHvMdZ8mXt/QlX6PHS3CsZ3G43vXajHwDC27M8Awx6lbtndLEDlFxQndnBJtMTVHd/VT6xrUcodHCVdAtusRVgdSK4a8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766053385; c=relaxed/simple; bh=ydQ8feFc8VtwelAhNXIl+iLP0G46zg+0OgA+doNhZSw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P5VgIhogMWSAF+XygaQrX3aWVL4n6mIQPAwTWp5hwydNGAykgMrBN8jnfR986Y/peIPfs4avKsdyLZjxOddQb/xQKetwSilTiT/p+dD1Hah0oK4wbG77RZS8w8X20GZ0gNnyMeGYadZk+Sx6kQ1ypnGqFnRRNE3IsQEZTbz1UJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=P4IHXNz0; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="P4IHXNz0" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3tHr+fSq/pc086pBg2+jvUTblwUU27lGCe6QFf32VoE=; b=P4IHXNz0DlFadDuNOqHRBr0wpB 4NdSmTBxr/duP872n4bL83+7/Ysht310McF9m3wmBpmZg/EN5LigDNBI7H1ZITR0oYsNFdJoLQjR7 gtmgfNsRro20H7YAOSyt7/pcXQ+213/zvaXOlF6BzxSn8zNK6HcB5qxCbtkxNVAANjYAvRs3EvGRr nM2N8p6sgPsfE72gCn+McRqZY06Ze3xWm1b338KfaVrMWj7aUfEhFWflLhT4RfzQDWoTZ8LBbIa+G 8c5Kri21t5kvHpTOdbITcU5Nqj3YvTdc+5lEmuhsfH9gHWi5G0KvoU1i/+XqSAUVHe5va/ad9IFIp ICd2RAEg==; Received: from 2001-1c00-8d85-5700-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:5700:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vWB9t-00000005z2N-1HQp; Thu, 18 Dec 2025 10:22:57 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5D2F630056B; Thu, 18 Dec 2025 11:22:56 +0100 (CET) Date: Thu, 18 Dec 2025 11:22:56 +0100 From: Peter Zijlstra To: Eric Dumazet Cc: "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel , Eric Dumazet Subject: Re: [PATCH] x86/irqflags: Force a register output in native_save_fl() Message-ID: <20251218102256.GP3707891@noisy.programming.kicks-ass.net> References: <20251218095434.1052422-1-edumazet@google.com> <0214B313-79AF-411F-AE04-8FF2705C5A92@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 18, 2025 at 11:15:37AM +0100, Eric Dumazet wrote: > > >--- a/arch/x86/include/asm/irqflags.h > > >+++ b/arch/x86/include/asm/irqflags.h > > >@@ -18,14 +18,9 @@ extern __always_inline unsigned long native_save_fl(void) > > > { > > > unsigned long flags; > > > > > >- /* > > >- * "=rm" is safe here, because "pop" adjusts the stack before > > >- * it evaluates its effective address -- this is part of the > > >- * documented behavior of the "pop" instruction. > > >- */ > > > asm volatile("# __raw_save_flags\n\t" > > > "pushf ; pop %0" > > >- : "=rm" (flags) > > >+ : "=r" (flags) > > > : /* no input */ > > > : "memory"); > > > > > > > Maybe report a bug to the clang team? > > This has been done 8 years ago. No progress so far... > > They claim we should use __builtin_ia32_readeflags_u64 / > __builtin_ia32_writeeflags_u64, which seems unlikely to please x86 > maintainers ? Yeah, because the "rm" thing not being supported properly goes way further than just this one case. And it really is abysmal that clang hasn't managed to implement it in all that time :/