linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linuxppc-dev@lists.ozlabs.org
Subject: [Bug 216041] Stack overflow at boot (do_IRQ: stack overflow: 1984) on a PowerMac G4 DP, KASAN debug build
Date: Sun, 29 May 2022 08:06:31 +0000	[thread overview]
Message-ID: <bug-216041-206035-yw3rav3C9j@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-216041-206035@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=216041

--- Comment #5 from Christophe Leroy (christophe.leroy@csgroup.eu) ---
There is an interrupt, that needs too looked at a bit deeper:

[eaa1c7a0] [c07d0bd4] dump_stack_lvl+0x60/0x90
[eaa1c7c0] [c0009234] __do_IRQ+0x170/0x174
[eaa1c800] [c0009258] do_IRQ+0x20/0x34
[eaa1c820] [c00045b4] HardwareInterrupt_virt+0x108/0x10c

The interesting part is __do_IRQ() :

void __do_IRQ(struct pt_regs *regs)
{
        struct pt_regs *old_regs = set_irq_regs(regs);
        void *cursp, *irqsp, *sirqsp;

        /* Switch to the irq stack to handle this */
        cursp = (void *)(current_stack_pointer & ~(THREAD_SIZE - 1));
        irqsp = hardirq_ctx[raw_smp_processor_id()];
        sirqsp = softirq_ctx[raw_smp_processor_id()];

        check_stack_overflow();

        /* Already there ? */
        if (unlikely(cursp == irqsp || cursp == sirqsp)) {
                __do_irq(regs);
                set_irq_regs(old_regs);
                return;
        }
        /* Switch stack and call */
        call_do_irq(regs, irqsp);

        set_irq_regs(old_regs);
}

The dump_stack() we see in the call trace is from check_stack_overflow(),
following the message "do_IRQ: stack overflow: 1984", because the stack dropped
below 0xeaa1c800

check_stack_overflow() function emits a warning and a stack dump when
CONFIG_DEBUG_STACKOVERFLOW is selected and only 2kbytes remain available on the
stack.

But here we get an Oops when the stack reaches 0xeaa1c000. Seems like the
2kbytes limit it not enough to properly perform the stack dump.

Commit 547db12fd8a0 ("powerpc/32: Use vmapped stacks for interrupts") doesn't
remove IRQ stacks. It change the IRQ stacks allocation from kmalloc to vmalloc.

Here we are stillon the original stack. The switch to the IRQ stack is
performed by call_do_irq().

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2022-05-29  8:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28 11:43 [Bug 216041] New: Stack overflow at boot (do_IRQ: stack overflow: 1984) on a PowerMac G4 DP, KASAN debug build bugzilla-daemon
2022-05-28 11:43 ` [Bug 216041] " bugzilla-daemon
2022-05-28 11:44 ` bugzilla-daemon
2022-05-28 17:59 ` bugzilla-daemon
2022-05-28 18:50 ` bugzilla-daemon
2022-05-29  8:06 ` bugzilla-daemon [this message]
2022-05-29 13:08 ` bugzilla-daemon
2022-06-08 22:54 ` bugzilla-daemon
2022-08-23 21:31 ` bugzilla-daemon
2023-04-12  0:47 ` bugzilla-daemon
2023-04-12  0:47 ` bugzilla-daemon
2023-04-12  0:47 ` bugzilla-daemon

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=bug-216041-206035-yw3rav3C9j@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).