All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parisc: don't enable irqs unconditionally in handle_interruption()
@ 2021-10-15 19:56 Sven Schnelle
       [not found] ` <969e8f20-d27c-77cd-62c1-ddb86213ddec@gmx.de>
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Schnelle @ 2021-10-15 19:56 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-parisc

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 --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
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-03 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-15 19:56 [PATCH] parisc: don't enable irqs unconditionally in handle_interruption() Sven Schnelle
     [not found] ` <969e8f20-d27c-77cd-62c1-ddb86213ddec@gmx.de>
     [not found]   ` <a5030b48-b6bc-639c-5360-0389103c228e@bell.net>
     [not found]     ` <ac539330-bdc2-1bba-e2c2-78d29614864f@bell.net>
     [not found]       ` <8bef26c2-daee-2a6c-1828-100a5b27e205@gmx.de>
     [not found]         ` <28325394-99de-67f4-dcca-b1caf1105df2@bell.net>
     [not found]           ` <87o87oxhhf.fsf@x1.stackframe.org>
     [not found]             ` <48780780-0f8c-5aa9-d362-a9b9ddeaeedb@gmx.de>
2021-10-20 18:32               ` [PATCH] parisc: Don't disable interrupts in cmpxchg and futex operations John David Anglin
2021-10-20 19:05                 ` Sven Schnelle
2021-11-03 14:42                   ` [PATCH v2] " Helge Deller
2021-11-03 15:41                     ` John David Anglin
2021-11-03 17:10                     ` Sven Schnelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.