<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/parisc/kernel/unwind.c, branch linux-6.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-11-04T11:21:59Z</updated>
<entry>
<title>parisc: Avoid crash due to unaligned access in unwinder</title>
<updated>2025-11-04T11:21:59Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2025-11-03T21:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd9f30d1038ee1624baa17a6ff11effe5f7617cb'/>
<id>urn:sha1:fd9f30d1038ee1624baa17a6ff11effe5f7617cb</id>
<content type='text'>
Guenter Roeck reported this kernel crash on his emulated B160L machine:

Starting network: udhcpc: started, v1.36.1
 Backtrace:
  [&lt;104320d4&gt;] unwind_once+0x1c/0x5c
  [&lt;10434a00&gt;] walk_stackframe.isra.0+0x74/0xb8
  [&lt;10434a6c&gt;] arch_stack_walk+0x28/0x38
  [&lt;104e5efc&gt;] stack_trace_save+0x48/0x5c
  [&lt;105d1bdc&gt;] set_track_prepare+0x44/0x6c
  [&lt;105d9c80&gt;] ___slab_alloc+0xfc4/0x1024
  [&lt;105d9d38&gt;] __slab_alloc.isra.0+0x58/0x90
  [&lt;105dc80c&gt;] kmem_cache_alloc_noprof+0x2ac/0x4a0
  [&lt;105b8e54&gt;] __anon_vma_prepare+0x60/0x280
  [&lt;105a823c&gt;] __vmf_anon_prepare+0x68/0x94
  [&lt;105a8b34&gt;] do_wp_page+0x8cc/0xf10
  [&lt;105aad88&gt;] handle_mm_fault+0x6c0/0xf08
  [&lt;10425568&gt;] do_page_fault+0x110/0x440
  [&lt;10427938&gt;] handle_interruption+0x184/0x748
  [&lt;11178398&gt;] schedule+0x4c/0x190
  BUG: spinlock recursion on CPU#0, ifconfig/2420
  lock: terminate_lock.2+0x0/0x1c, .magic: dead4ead, .owner: ifconfig/2420, .owner_cpu: 0

While creating the stack trace, the unwinder uses the stack pointer to guess
the previous frame to read the previous stack pointer from memory.  The crash
happens, because the unwinder tries to read from unaligned memory and as such
triggers the unalignment trap handler which then leads to the spinlock
recursion and finally to a deadlock.

Fix it by checking the alignment before accessing the memory.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: stable@vger.kernel.org # v6.12+
</content>
</entry>
<entry>
<title>parisc: Fix stack unwinder</title>
<updated>2024-02-19T20:55:22Z</updated>
<author>
<name>Guenter Roeck</name>
</author>
<published>2024-02-15T21:51:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=882a2a724ee964c1ebe7268a91d5c8c8ddc796bf'/>
<id>urn:sha1:882a2a724ee964c1ebe7268a91d5c8c8ddc796bf</id>
<content type='text'>
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 &lt;deller@gmx.de&gt;
Cc: Sven Schnelle &lt;svens@stackframe.org&gt;
Cc: John David Anglin &lt;dave.anglin@bell.net&gt;
Cc: Charlie Jenkins &lt;charlie@rivosinc.com&gt;
Cc: David Laight &lt;David.Laight@ACULAB.COM&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: unwind: Avoid missing prototype warning for handle_interruption()</title>
<updated>2023-07-03T16:56:03Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2023-07-03T16:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6414b30b39f9d21fcd485aab6e20b7c65f4013d8'/>
<id>urn:sha1:6414b30b39f9d21fcd485aab6e20b7c65f4013d8</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: unwind: Mark start and stop variables __maybe_unused</title>
<updated>2023-06-30T15:14:15Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2023-06-30T10:44:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7fde0bf938d5839df6d89b39eb7f5d834c703ec'/>
<id>urn:sha1:a7fde0bf938d5839df6d89b39eb7f5d834c703ec</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: Move thread_info into task struct</title>
<updated>2021-11-01T06:35:59Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2021-10-15T08:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2214c0e77259b420402e279e9ab4277ef320d371'/>
<id>urn:sha1:2214c0e77259b420402e279e9ab4277ef320d371</id>
<content type='text'>
This implements the CONFIG_THREAD_INFO_IN_TASK option.

With this change:
- before thread_info was part of the stack and located at the beginning of the stack
- now the thread_info struct is moved and located inside the task_struct structure
- the stack is allocated and handled like the major other platforms
- drop the cpu field of thread_info and use instead the one in task_struct

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Sven Schnelle &lt;svens@stackframe.org&gt;
</content>
</entry>
<entry>
<title>parisc/unwind: fix unwinder when CONFIG_64BIT is enabled</title>
<updated>2021-11-01T06:35:58Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2021-10-09T21:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e0ba125c2bf1030af3267058019ba86da96863f'/>
<id>urn:sha1:8e0ba125c2bf1030af3267058019ba86da96863f</id>
<content type='text'>
With 64 bit kernels unwind_special() is not working because
it compares the pc to the address of the function descriptor.
Add a helper function that compares pc with the dereferenced
address. This fixes all of the backtraces on my c8000. Without
this changes, a lot of backtraces are missing in kdb or the
show-all-tasks command from /proc/sysrq-trigger.

Signed-off-by: Sven Schnelle &lt;svens@stackframe.org&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc/unwind: use copy_from_kernel_nofault()</title>
<updated>2021-10-30T21:11:00Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2021-09-30T17:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf2ec7893f876f4c30aed8a76bb4ebacdce74dd3'/>
<id>urn:sha1:cf2ec7893f876f4c30aed8a76bb4ebacdce74dd3</id>
<content type='text'>
I have no idea why get_user() is used there, but we're unwinding the
kernel stack, so we should use copy_from_kernel_nofault().

Signed-off-by: Sven Schnelle &lt;svens@stackframe.org&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: Use __ro_after_init in unwind.c</title>
<updated>2019-05-10T19:00:45Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2019-05-10T18:55:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47293774c49c174c9863a60a757b825299ddf649'/>
<id>urn:sha1:47293774c49c174c9863a60a757b825299ddf649</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: Fix uninitialized variable usage in unwind.c</title>
<updated>2018-10-16T09:37:29Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2018-10-16T06:21:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf8afe5c53621eda385be961bc72329a2adcd767'/>
<id>urn:sha1:cf8afe5c53621eda385be961bc72329a2adcd767</id>
<content type='text'>
As noticed by Dave Anglin, the last commit introduced a small bug where
the potentially uninitialized r struct is used instead of the regs
pointer as input for unwind_frame_init(). Fix it.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Reported-by: John David Anglin &lt;dave.anglin@bell.net&gt;
</content>
</entry>
<entry>
<title>parisc: Fix boot failure of 64-bit kernel</title>
<updated>2018-08-21T12:32:44Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2018-08-21T12:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8801ccb9fa524c195322c26b6d44e99827772bde'/>
<id>urn:sha1:8801ccb9fa524c195322c26b6d44e99827772bde</id>
<content type='text'>
Commit c8921d72e390 ("parisc: Fix and improve kernel stack unwinding")
broke booting of 64-bit kernels. On 64-bit kernels function pointers are
actually function descriptors which require dereferencing. In this patch
we instead declare functions in assembly code which are referenced from
C-code as external data pointers with the ENTRY() macro and thus can use
a simple external reference to the functions.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Fixes: c8921d72e390 ("parisc: Fix and improve kernel stack unwinding")
</content>
</entry>
</feed>
