ARM: entry: fix unwinder problems caused by IRQ stacks
authorArd Biesheuvel <ardb@kernel.org>
Thu, 10 Mar 2022 16:24:45 +0000 (17:24 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 11 Mar 2022 12:59:32 +0000 (12:59 +0000)
commit7a8ca84a258a79e564b77b1bbb139f3f561d149b
tree457ca0983822c650d109e4f19bdd1864fbf006af
parentc46c2c9b43f4f08f20dc06417fbf7091e4ca6d34
ARM: entry: fix unwinder problems caused by IRQ stacks

The IRQ stacks series made some changes to the unwinder, to permit
unwinding across different stacks. This is needed because otherwise, the
call stack would terminate at the point where the stack switch between
the task stack and the IRQ stack occurs, which would defeat any
diagnostics that rely on timer interrupts, such as RCU stall detection.

Unfortunately, getting the unwind annotations correct turns out to be
difficult, given that this now involves a frame pointer which needs to
point into the right location in the task stack when unwinding from the
IRQ stack. Getting this wrong for an exception handling routine results
in the stack pointer to be unwound from the wrong location, causing any
subsequent unwind attempts to cause all kinds of issues, as reported by
Naresh here [0].

So let's simplify this, by deferring the stack switch to
call_with_stack(), which already has the correct unwind annotations, and
removing all the complicated handling of the stack frame from the IRQ
exception entrypoint itself.

[0] https://lore.kernel.org/all/CA+G9fYtpy8VgK+ag6OsA9TDrwi5YGU4hu7GM8xwpO7v6LrCD4Q@mail.gmail.com/

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/entry-armv.S