From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
linux-kernel@vger.kernel.org,
Mukesh Kumar Chaurasiya <mkchauras@gmail.com>,
chleroy@kernel.org,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: [PATCH] powerpc/entry: Trace the IRQ disable before irqentry_exit() on 32-bit
Date: Sat, 31 Oct 2026 17:41:37 +0530 [thread overview]
Message-ID: <a14571be1897955f43d9994f0e093de3ada6ecde.1793447880.git.ritesh.list@gmail.com> (raw)
Commit 63a7531ca31f ("powerpc/entry: Fix irq_soft_mask corruption on
replayed interrupt exit") changed arch_interrupt_exit_prepare() to
disable interrupts with hard_irq_disable() instead of
local_irq_disable().
This is correct for 64-bit (since it takes care of everything there)
however, it breaks lockdep on 32-bit.
exceptions such has page fault handling (do_page_fault()), re-enables
interrupts since handling a page fault can sleep. Then generic irq exit
expects the arch to disable the interrupts back before returning to the
user/kernel in their arch_interrupt_exit_prepare() function, before
irqentry_exit() is called. irqentry_exit() then checks for lockdep's irq
tracing state and expects the interrupts to be off.
Note that on 32-bit we don't have any soft mask and hard_irq_disable()
just clears the MSR[EE] state and does not update the irq tracing state
unlikes local_irq_disable(). This causes the lockdep to warn like:
WARNING: include/linux/irq-entry-common.h:540 at irqentry_exit+0x398/0xd1c, CPU#1: init/1
NIP irqentry_exit+0x398/0xd1c
LR do_page_fault+0x390/0x7b4
Call Trace:
do_page_fault+0x218/0x7b4
DataStorage+0x15c/0x180
--- interrupt: 300 at __arch_clear_user+0x10/0xcc
WARNING: include/linux/irq-entry-common.h:312 at irqentry_exit+0x224/0xd1c, CPU#1: init/1
NIP irqentry_exit+0x224/0xd1c
LR do_page_fault+0x390/0x7b4
Call Trace:
__per_cpu_offset+0x0/0x60 (unreliable)
do_page_fault+0x390/0x7b4
InstructionStorage+0x150/0x160
---- interrupt: 400 at 0xb77b059c
So, use local_irq_disable() on 32-bit which clears MSR[EE] and also
records the transition for lockdep. For 64-bit we keep hard_irq_disable().
Fixes: 63a7531ca31f ("powerpc/entry: Fix irq_soft_mask corruption on replayed interrupt exit")
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
This was caught during debugging some other issue on 32-bit platform.
When lockdep is enabled there, this warning can be easily seen during bootup
itself.
arch/powerpc/include/asm/entry-common.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h
index 8e91489fdf2b..c944a267532d 100644
--- a/arch/powerpc/include/asm/entry-common.h
+++ b/arch/powerpc/include/asm/entry-common.h
@@ -268,7 +268,10 @@ static inline void arch_interrupt_exit_prepare(struct pt_regs *regs)
}
/* irqentry_exit expects to be called with interrupts disabled */
- hard_irq_disable();
+ if (IS_ENABLED(CONFIG_PPC64))
+ hard_irq_disable();
+ else
+ local_irq_disable();
}
static inline void arch_interrupt_async_enter_prepare(struct pt_regs *regs)
--
2.39.5
reply other threads:[~2026-10-31 12:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a14571be1897955f43d9994f0e093de3ada6ecde.1793447880.git.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mkchauras@gmail.com \
--cc=venkat88@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®