* [PATCH] powerpc/irq: Don't switch to irq stack from softirq stack
@ 2013-10-07 21:08 Benjamin Herrenschmidt
2013-10-07 21:20 ` Linus Torvalds
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2013-10-07 21:08 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Cédric Le Goater, linuxppc-dev
irq_exit() is now called on the irq stack, which can trigger a switch
to the softirq stack from the irq stack. If an interrupt happens at
that point, we will not properly detect the re-entrancy and clobber
the original return context on the irq stack.
This fixes it. The side effect is to prevent all nesting from softirq
stack to irq stack even in the "safe" case but it's simpler that way
and matches what x86_64 does.
Reported-by: Cédric Le Goater <clg@fr.ibm.com>
Tested-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Linus, I don't have my git repo at hand right now and this is pretty
urgent, can you apply it directly please ?
Cheers,
Ben.
arch/powerpc/kernel/irq.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 57d286a..c7cb8c2 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -495,14 +495,15 @@ void __do_irq(struct pt_regs *regs)
void do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
- struct thread_info *curtp, *irqtp;
+ struct thread_info *curtp, *irqtp, *sirqtp;
/* Switch to the irq stack to handle this */
curtp = current_thread_info();
irqtp = hardirq_ctx[raw_smp_processor_id()];
+ sirqtp = softirq_ctx[raw_smp_processor_id()];
/* Already there ? */
- if (unlikely(curtp == irqtp)) {
+ if (unlikely(curtp == irqtp || curtp == sirqtp)) {
__do_irq(regs);
set_irq_regs(old_regs);
return;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/irq: Don't switch to irq stack from softirq stack
2013-10-07 21:08 [PATCH] powerpc/irq: Don't switch to irq stack from softirq stack Benjamin Herrenschmidt
@ 2013-10-07 21:20 ` Linus Torvalds
0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2013-10-07 21:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Cédric Le Goater, linuxppc-dev
On Mon, Oct 7, 2013 at 2:08 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
>
> Linus, I don't have my git repo at hand right now and this is pretty
> urgent, can you apply it directly please ?
Done.
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-07 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07 21:08 [PATCH] powerpc/irq: Don't switch to irq stack from softirq stack Benjamin Herrenschmidt
2013-10-07 21:20 ` Linus Torvalds
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.