From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BCDC382389 for ; Mon, 20 Apr 2026 14:14:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776694497; cv=none; b=kbICVJKGMz6GL4DMuDe58eRdfIxm79GjGuZVIKYiTBH8XEmW8buIKOyjnCmNz58LU1YeL+pjf1Fcp6zKG1mWDtd95mTHk+RC03n2+uyG/ljSRd6WfzTOaWhtiVwRKePr5pb4O1cmx8I6IM8MDrt1yle69xLtgLj4i3RmJlizDC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776694497; c=relaxed/simple; bh=SpGIaEO+7YDPT6wqwPtFUdsz9O2FOsqYjyt7X+bnG/k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y8O4ogTbt45G6jjRdFDllq28yhgaOhvlyLvS3MYe1cGB79MBX3/GVcx7ofZqPoDj2enBBM+FwvyDoz9mzlyCQhKi0rzozHfaqd4uwfcxu7acwnUatNEZOSbrYZ0rj4NNysaN71VymPWGH0KSLndeO5JeOP4zuy0Nb7BZP05JqoA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=p8nxiXMM; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="p8nxiXMM" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0FAF51516; Mon, 20 Apr 2026 07:14:48 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A5A0A3F7B4; Mon, 20 Apr 2026 07:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1776694493; bh=SpGIaEO+7YDPT6wqwPtFUdsz9O2FOsqYjyt7X+bnG/k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p8nxiXMMinxckJ9ZLOcltuhZulg6xfO98CBq7Tp2DdYdMlKcpampDDAL2zPuQ6aix KQlG1bUSXOIH61XNE37+ldY3eoXS/27aJ4N2zD7THcQ34VVCAqrInxExB4vbzKhn8a UzXgffCdno/WGaXqNsvp6PR23jc11+wZ/5/My3kM= Date: Mon, 20 Apr 2026 15:14:49 +0100 From: Mark Rutland To: Breno Leitao Cc: Catalin Marinas , Will Deacon , leo.bras@arm.com, leo.yan@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, palmer@dabbelt.com, paulmck@kernel.org, puranjay@kernel.org, usama.arif@linux.dev, kernel-team@meta.com Subject: Re: [PATCH RFC] arm64/irqflags: force inline of arch_local_irq_enable() Message-ID: References: <20260420-arm64_always_inline-v1-1-dba919cf46bc@debian.org> 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 Mon, Apr 20, 2026 at 06:15:24AM -0700, Breno Leitao wrote: > On Mon, Apr 20, 2026 at 02:06:23PM +0100, Mark Rutland wrote: > > On Mon, Apr 20, 2026 at 05:42:11AM -0700, Breno Leitao wrote: > > > arch_local_irq_enable() is a small wrapper that dispatches between two > > > unmask paths: __daif_local_irq_enable() on most systems, and > > > __pmr_local_irq_enable() on builds that use GIC PMR-based masking > > > (Pseudo-NMI). Both leaf primitives are already __always_inline; the > > > wrapper itself is plain "static inline". > > > > > > In practice the compiler does not always inline the wrapper. > > > > I think this was my mistake, and we should have marked all the helpers > > as __always_inline for noinstr safety, as x86 did in commit: > > > > 7a745be1cc90 ("x86/entry: __always_inline irqflags for noinstr") > > > > I think we should mark all of the following as __always_inline in one > > go: > > > > * arch_local_irq_enable() > > * arch_local_irq_disable() > > * arch_local_save_flags() > > * arch_irqs_disabled_flags() > > * arch_irqs_disabled() > > * arch_local_irq_save() > > * arch_local_irq_restore() > > > > ... which then ensures noinstr safety, and has the side benefit of > > giving nicer traces as you're suggesting here. > > > > Are you happy to try that? > > Absolutely, I'll work on testing it that and put together a patch > addressing all of them. > > Should this be targeted for stable backports as well? If so, which > commit should I reference in the Fixes tag? I don't think we need to worry about backporting, and can do this as a cleanup for now unless someone shouts that they're seeing brokenness in a stable kernel. There's no specific commit for a fixes tag; this has always been a bit dodgy, but we've evidently been getting away with it in practice. Mark.