diff mbox series

parisc: don't enable irqs unconditionally in handle_interruption()

Message ID 20211015195612.25203-1-svens@stackframe.org (mailing list archive)
State Accepted, archived
Headers show
Series parisc: don't enable irqs unconditionally in handle_interruption() | expand

Commit Message

Sven Schnelle Oct. 15, 2021, 7:56 p.m. UTC
If the previous context had interrupts disabled, we should better
keep them disabled. This was noticed in the unwinding code where
a copy_from_kernel_nofault() triggered a page fault, and after
the fixup by the page fault handler interrupts where suddenly
enabled.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 arch/parisc/kernel/traps.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 690e6abcaf22..3c5d968da415 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -480,9 +480,9 @@  void notrace handle_interruption(int code, struct pt_regs *regs)
 	int si_code;
 
 	if (code == 1)
-	    pdc_console_restart();  /* switch back to pdc if HPMC */
-	else
-	    local_irq_enable();
+		pdc_console_restart();  /* switch back to pdc if HPMC */
+	else if (!irqs_disabled_flags(regs->gr[0]))
+		local_irq_enable();
 
 	/* Security check:
 	 * If the priority level is still user, and the