parisc: Fix stack unwinder
authorGuenter Roeck <linux@roeck-us.net>
Thu, 15 Feb 2024 21:51:45 +0000 (13:51 -0800)
committerHelge Deller <deller@gmx.de>
Mon, 19 Feb 2024 20:55:22 +0000 (21:55 +0100)
commit882a2a724ee964c1ebe7268a91d5c8c8ddc796bf
treed414e5f1e1ff0578e482dcd69dd9019eb3b8c2a3
parentf945a404ed8a6eeb9907ef122a8382df56c2a714
parisc: Fix stack unwinder

Debugging shows a large number of unaligned access traps in the unwinder
code. Code analysis reveals a number of issues with this code:

- handle_interruption is passed twice through
  dereference_kernel_function_descriptor()
- ret_from_kernel_thread, syscall_exit, intr_return,
  _switch_to_ret, and _call_on_stack are passed through
  dereference_kernel_function_descriptor() even though they are
  not declared as function pointers.

To fix the problems, drop one of the calls to
dereference_kernel_function_descriptor() for handle_interruption,
and compare the other pointers directly.

Fixes: 6414b30b39f9 ("parisc: unwind: Avoid missing prototype warning for handle_interruption()")
Fixes: 8e0ba125c2bf ("parisc/unwind: fix unwinder when CONFIG_64BIT is enabled")
Cc: Helge Deller <deller@gmx.de>
Cc: Sven Schnelle <svens@stackframe.org>
Cc: John David Anglin <dave.anglin@bell.net>
Cc: Charlie Jenkins <charlie@rivosinc.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/unwind.c