Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 5345D439006 for ; Fri, 27 Feb 2026 15:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772205552; cv=none; b=V0eUVvho93n0UwyB8gXP2XqhemkfF5t6DJqg4i5pEkNoUpEG7TdtKnpjYU56rE7sYfmCqCdyYoPzeKwgbrOe7WhzpXZ18SRedNcSGC6N/SlYweGCz4Uq2+dL2UcuJrGyi4zRO9zN9++YA6IUxO0ld3TQuWU2Oe1xRFcWPfVRF0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772205552; c=relaxed/simple; bh=mgJ7ZUKuCYlv1mqwA2XfAHyKbFaqy6XrRCRjHEh1XX0=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=iZEE7Y05LEx2SQVkXX4uiNb7yy/+gt7+KoSeKvTlSyS5xaL46Sm3KkUkklA4kJhEcLUr5L4794CEEvcKYH/hlfMnlUE+0ROqiNJi0qWBPvct9yx8nj1774CU4h81k+tVOMLT++VuXix6bggs1+CtlNl+9JNuzFguAW5gXmNzAWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=WQCDPmEv; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="WQCDPmEv" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yCfQxddkyDwE/ZVIAKmmYVcFHnwdOp0PPR0xfQ+Nrn4=; b=WQCDPmEvC8TF/7AdOjv8/t2Nzf CiIsqCkRC6N7ia/xF4vLs0eEKQGTZ1QUL9645Ec9A9uYj+isHuk+wGVbN9JqMgtOv/YDeAAHsEauc dDtzzzZbOcDkOddAnnFSAutU3k5/EAAAAzg4bz+IJacG/1dvgbb21Wka3oo23yjOO047HuGZ5TbE5 FqULwabtYk1hyPAMKo+BFexIiaOr+LxA32MzaEToOfAnBZIjPmps0RYM6ds/VCGYt9Tftss6OzuKW 7CFp8o8Fbb0qmVNy4ubhgcEEjkv/lAzzw7dRovqoGK0oVFUjLv/2kp+O6LDubdyshnXtVdtT9FUCF U5PUfkiA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:52946 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvzcT-000000000xs-0X4G; Fri, 27 Feb 2026 15:19:09 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vvzcS-0000000Awnu-1u0H; Fri, 27 Feb 2026 15:19:08 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: linux-arm-kernel@lists.infradead.org Cc: Clark Williams , linux-rt-devel@lists.linux.dev, Sebastian Andrzej Siewior , Steven Rostedt Subject: [PATCH 1/6] ARM: ensure interrupts are enabled in __do_user_fault() Precedence: bulk X-Mailing-List: linux-rt-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Fri, 27 Feb 2026 15:19:08 +0000 __do_user_fault() may be called from fault handling paths where the interrupts are enabled or disabled. E.g. do_page_fault() calls this with interrupts enabled, whereas do_sect_fault()->do_bad_area() will call this with interrupts disabled. Since this is a userspace fault, we know that interrupts were enabled in the parent context, so call local_irq_enable() here to give a consistent interrupt state. This is necessary for force_sig_info() when PREEMPT_RT is enabled. Signed-off-by: Russell King (Oracle) --- arch/arm/mm/fault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index ed4330cc3f4e..6c27ebd49093 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -190,7 +190,8 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, /* * Something tried to access memory that isn't in our memory map.. - * User mode accesses just cause a SIGSEGV + * User mode accesses just cause a SIGSEGV. Ensure interrupts are enabled + * for preempt RT. */ static void __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, @@ -198,6 +199,8 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, { struct task_struct *tsk = current; + local_irq_enable(); + #ifdef CONFIG_DEBUG_USER if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) || ((user_debug & UDBG_BUS) && (sig == SIGBUS))) { @@ -268,6 +271,7 @@ do_kernel_address_page_fault(struct mm_struct *mm, unsigned long addr, * should not be faulting in kernel space, which includes the * vector/khelper page. Handle the branch predictor hardening * while interrupts are still disabled, then send a SIGSEGV. + * Note that __do_user_fault() will enable interrupts. */ harden_branch_predictor(); __do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs); -- 2.47.3