<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/arm/kernel/stacktrace.c, branch v5.7-rc6</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ARM: 8948/1: Prevent OOB access in stacktrace</title>
<updated>2020-01-25T18:18:11+00:00</updated>
<author>
<name>Vincent Whitchurch</name>
<email>vincent.whitchurch@axis.com</email>
</author>
<published>2019-12-16T10:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=40ff1ddb5570284e039e0ff14d7a859a73dc3673'/>
<id>40ff1ddb5570284e039e0ff14d7a859a73dc3673</id>
<content type='text'>
The stacktrace code can read beyond the stack size, when it attempts to
read pt_regs from exception frames.

This can happen on normal, non-corrupt stacks.  Since the unwind
information in the extable is not correct for function prologues, the
unwinding code can return data from the stack which is not actually the
caller function address, and if in_entry_text() happens to succeed on
this value, we can end up reading data from outside the task's stack
when attempting to read pt_regs, since there is no bounds check.

Example:

 [&lt;8010e729&gt;] (unwind_backtrace) from [&lt;8010a9c9&gt;] (show_stack+0x11/0x14)
 [&lt;8010a9c9&gt;] (show_stack) from [&lt;8057d8d7&gt;] (dump_stack+0x87/0xac)
 [&lt;8057d8d7&gt;] (dump_stack) from [&lt;8012271d&gt;] (tasklet_action_common.constprop.4+0xa5/0xa8)
 [&lt;8012271d&gt;] (tasklet_action_common.constprop.4) from [&lt;80102333&gt;] (__do_softirq+0x11b/0x31c)
 [&lt;80102333&gt;] (__do_softirq) from [&lt;80122485&gt;] (irq_exit+0xad/0xd8)
 [&lt;80122485&gt;] (irq_exit) from [&lt;8015f3d7&gt;] (__handle_domain_irq+0x47/0x84)
 [&lt;8015f3d7&gt;] (__handle_domain_irq) from [&lt;8036a523&gt;] (gic_handle_irq+0x43/0x78)
 [&lt;8036a523&gt;] (gic_handle_irq) from [&lt;80101a49&gt;] (__irq_svc+0x69/0xb4)
 Exception stack(0xeb491f58 to 0xeb491fa0)
 1f40:                                                       7eb14794 00000000
 1f60: ffffffff 008dd32c 008dd324 ffffffff 008dd314 0000002a 801011e4 eb490000
 1f80: 0000002a 7eb1478c 50c5387d eb491fa8 80101001 8023d09c 40080033 ffffffff
 [&lt;80101a49&gt;] (__irq_svc) from [&lt;8023d09c&gt;] (do_pipe2+0x0/0xac)
 [&lt;8023d09c&gt;] (do_pipe2) from [&lt;ffffffff&gt;] (0xffffffff)
 Exception stack(0xeb491fc8 to 0xeb492010)
 1fc0:                   008dd314 0000002a 00511ad8 008de4c8 7eb14790 7eb1478c
 1fe0: 00511e34 7eb14774 004c8557 76f44098 60080030 7eb14794 00000000 00000000
 2000: 00000001 00000000 ea846c00 ea847cc0

In this example, the stack limit is 0xeb492000, but 16 bytes outside the
stack have been read.

Fix it by adding bounds checks.

Signed-off-by: Vincent Whitchurch &lt;vincent.whitchurch@axis.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The stacktrace code can read beyond the stack size, when it attempts to
read pt_regs from exception frames.

This can happen on normal, non-corrupt stacks.  Since the unwind
information in the extable is not correct for function prologues, the
unwinding code can return data from the stack which is not actually the
caller function address, and if in_entry_text() happens to succeed on
this value, we can end up reading data from outside the task's stack
when attempting to read pt_regs, since there is no bounds check.

Example:

 [&lt;8010e729&gt;] (unwind_backtrace) from [&lt;8010a9c9&gt;] (show_stack+0x11/0x14)
 [&lt;8010a9c9&gt;] (show_stack) from [&lt;8057d8d7&gt;] (dump_stack+0x87/0xac)
 [&lt;8057d8d7&gt;] (dump_stack) from [&lt;8012271d&gt;] (tasklet_action_common.constprop.4+0xa5/0xa8)
 [&lt;8012271d&gt;] (tasklet_action_common.constprop.4) from [&lt;80102333&gt;] (__do_softirq+0x11b/0x31c)
 [&lt;80102333&gt;] (__do_softirq) from [&lt;80122485&gt;] (irq_exit+0xad/0xd8)
 [&lt;80122485&gt;] (irq_exit) from [&lt;8015f3d7&gt;] (__handle_domain_irq+0x47/0x84)
 [&lt;8015f3d7&gt;] (__handle_domain_irq) from [&lt;8036a523&gt;] (gic_handle_irq+0x43/0x78)
 [&lt;8036a523&gt;] (gic_handle_irq) from [&lt;80101a49&gt;] (__irq_svc+0x69/0xb4)
 Exception stack(0xeb491f58 to 0xeb491fa0)
 1f40:                                                       7eb14794 00000000
 1f60: ffffffff 008dd32c 008dd324 ffffffff 008dd314 0000002a 801011e4 eb490000
 1f80: 0000002a 7eb1478c 50c5387d eb491fa8 80101001 8023d09c 40080033 ffffffff
 [&lt;80101a49&gt;] (__irq_svc) from [&lt;8023d09c&gt;] (do_pipe2+0x0/0xac)
 [&lt;8023d09c&gt;] (do_pipe2) from [&lt;ffffffff&gt;] (0xffffffff)
 Exception stack(0xeb491fc8 to 0xeb492010)
 1fc0:                   008dd314 0000002a 00511ad8 008de4c8 7eb14790 7eb1478c
 1fe0: 00511e34 7eb14774 004c8557 76f44098 60080030 7eb14794 00000000 00000000
 2000: 00000001 00000000 ea846c00 ea847cc0

In this example, the stack limit is 0xeb492000, but 16 bytes outside the
stack have been read.

Fix it by adding bounds checks.

Signed-off-by: Vincent Whitchurch &lt;vincent.whitchurch@axis.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier for missed files</title>
<updated>2019-05-21T08:50:45+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-19T12:08:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=457c89965399115e5cd8bf38f9c597293405703d'/>
<id>457c89965399115e5cd8bf38f9c597293405703d</id>
<content type='text'>
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
   initial scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
   initial scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm/stacktrace: Remove the pointless ULONG_MAX marker</title>
<updated>2019-04-14T17:58:27+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-04-10T10:27:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a2bcfa0c94d8bc4770676a6799928036296c037'/>
<id>2a2bcfa0c94d8bc4770676a6799928036296c037</id>
<content type='text'>
Terminating the last trace entry with ULONG_MAX is a completely pointless
exercise and none of the consumers can rely on it because it's
inconsistently implemented across architectures. In fact quite some of the
callers remove the entry and adjust stack_trace.nr_entries afterwards.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lkml.kernel.org/r/20190410103643.843075256@linutronix.de

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Terminating the last trace entry with ULONG_MAX is a completely pointless
exercise and none of the consumers can rely on it because it's
inconsistently implemented across architectures. In fact quite some of the
callers remove the entry and adjust stack_trace.nr_entries afterwards.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lkml.kernel.org/r/20190410103643.843075256@linutronix.de

</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code</title>
<updated>2017-12-17T22:14:21+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2017-11-24T23:54:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c608906165355089a4de3c9133c72e81e011096c'/>
<id>c608906165355089a4de3c9133c72e81e011096c</id>
<content type='text'>
Avoid adding kprobes to any of the kernel entry/exit or startup
assembly code, or code in the identity-mapped region.  This code does
not conform to the standard C conventions, which means that the
expectations of the kprobes code is not forfilled.

Placing kprobes at some of these locations results in the kernel trying
to return to userspace addresses while retaining the CPU in kernel mode.

Tested-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid adding kprobes to any of the kernel entry/exit or startup
assembly code, or code in the identity-mapped region.  This code does
not conform to the standard C conventions, which means that the
expectations of the kprobes code is not forfilled.

Placing kprobes at some of these locations results in the kernel trying
to return to userspace addresses while retaining the CPU in kernel mode.

Tested-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: 8691/1: Export save_stack_trace_tsk()</title>
<updated>2017-09-09T15:26:42+00:00</updated>
<author>
<name>Dustin Brown</name>
<email>dustinb@codeaurora.org</email>
</author>
<published>2017-08-07T18:44:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9a3dc3186fc3795e076a4122da9e0258651a9631'/>
<id>9a3dc3186fc3795e076a4122da9e0258651a9631</id>
<content type='text'>
The kernel watchdog is a great debugging tool for finding tasks that
consume a disproportionate amount of CPU time in contiguous chunks. One
can imagine building a similar watchdog for arbitrary driver threads
using save_stack_trace_tsk() and print_stack_trace(). However, this is
not viable for dynamically loaded driver modules on ARM platforms
because save_stack_trace_tsk() is not exported for those architectures.
Export save_stack_trace_tsk() for the ARM architecture to align with
x86 and support various debugging use cases such as arbitrary driver
thread watchdog timers.

Signed-off-by: Dustin Brown &lt;dustinb@codeaurora.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The kernel watchdog is a great debugging tool for finding tasks that
consume a disproportionate amount of CPU time in contiguous chunks. One
can imagine building a similar watchdog for arbitrary driver threads
using save_stack_trace_tsk() and print_stack_trace(). However, this is
not viable for dynamically loaded driver modules on ARM platforms
because save_stack_trace_tsk() is not exported for those architectures.
Export save_stack_trace_tsk() for the ARM architecture to align with
x86 and support various debugging use cases such as arbitrary driver
thread watchdog timers.

Signed-off-by: Dustin Brown &lt;dustinb@codeaurora.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched/headers: Prepare for new header dependencies before moving code to &lt;linux/sched/debug.h&gt;</title>
<updated>2017-03-02T07:42:34+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2017-02-08T17:51:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b17b01533b719e9949e437abf66436a875739b40'/>
<id>b17b01533b719e9949e437abf66436a875739b40</id>
<content type='text'>
We are going to split &lt;linux/sched/debug.h&gt; out of &lt;linux/sched.h&gt;, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder &lt;linux/sched/debug.h&gt; file that just
maps to &lt;linux/sched.h&gt; to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are going to split &lt;linux/sched/debug.h&gt; out of &lt;linux/sched.h&gt;, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder &lt;linux/sched/debug.h&gt; file that just
maps to &lt;linux/sched.h&gt; to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: 8172/1: Use current_stack_pointer in save_stack_trace_tsk</title>
<updated>2014-11-13T23:58:03+00:00</updated>
<author>
<name>Behan Webster</name>
<email>behanw@converseincode.com</email>
</author>
<published>2014-09-26T23:31:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=74dbeee0fcded9525ddb42b53ee75dc62c8089d9'/>
<id>74dbeee0fcded9525ddb42b53ee75dc62c8089d9</id>
<content type='text'>
Use the global current_stack_pointer to get the value of the stack pointer.
This change supports being able to compile the kernel with both gcc and clang.

Signed-off-by: Behan Webster &lt;behanw@converseincode.com&gt;
Reviewed-by: Mark Charlebois &lt;charlebm@gmail.com&gt;
Reviewed-by: Jan-Simon Möller &lt;dl9pf@gmx.de&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the global current_stack_pointer to get the value of the stack pointer.
This change supports being able to compile the kernel with both gcc and clang.

Signed-off-by: Behan Webster &lt;behanw@converseincode.com&gt;
Reviewed-by: Mark Charlebois &lt;charlebm@gmail.com&gt;
Reviewed-by: Jan-Simon Möller &lt;dl9pf@gmx.de&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: 8049/1: ftrace/add save_stack_trace_regs() implementation</title>
<updated>2014-05-30T00:12:32+00:00</updated>
<author>
<name>Lin Yongting</name>
<email>linyongting@gmail.com</email>
</author>
<published>2014-05-04T15:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9c986661638c69772f5479c4715061239ec61b29'/>
<id>9c986661638c69772f5479c4715061239ec61b29</id>
<content type='text'>
When configure kprobe events of ftrace with "stacktrace" option enabled
in arm, there is no stacktrace was recorded after the kprobe event was
triggered. The root cause is no save_stack_trace_regs() function implemented.

Implement the save_stack_trace_regs() function in arm, then ftrace will
call this architecture-related function to record the stacktrace into
ring buffer.

After this fix, stacktrace can be recorded, for example:

 # mount -t debugfs nodev /sys/kernel/debug
 # echo "p:netrx net_rx_action" &gt;&gt; /sys/kernel/debug/tracing/kprobe_events
 # echo 1 &gt; /sys/kernel/debug/tracing/events/kprobes/netrx/enable
 # echo 1 &gt; /sys/kernel/debug/tracing/options/stacktrace
 # echo 1 &gt; /sys/kernel/debug/tracing/tracing_on
 # ping 127.0.0.1 -c 1
 # echo 0 &gt; /sys/kernel/debug/tracing/tracing_on

 # cat /sys/kernel/debug/tracing/trace
 # tracer: nop
 #
 # entries-in-buffer/entries-written: 12/12   #P:1
 #
 #                              _-----=&gt; irqs-off
 #                             / _----=&gt; need-resched
 #                            | / _---=&gt; hardirq/softirq
 #                            || / _--=&gt; preempt-depth
 #                            ||| /     delay
 #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
 #              | |       |   ||||       |         |
             &lt;------ missing some entries ----------------&gt;
             ping-1200  [000] dNs1   667.603250: netrx: (net_rx_action+0x0/0x1f8)
             ping-1200  [000] dNs1   667.604738: &lt;stack trace&gt;
  =&gt; net_rx_action
  =&gt; do_softirq
  =&gt; local_bh_enable
  =&gt; ip_finish_output
  =&gt; ip_output
  =&gt; ip_local_out
  =&gt; ip_send_skb
  =&gt; ip_push_pending_frames
  =&gt; raw_sendmsg
  =&gt; inet_sendmsg
  =&gt; sock_sendmsg
  =&gt; SyS_sendto
  =&gt; ret_fast_syscall

Signed-off-by: Lin Yongting &lt;linyongting@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When configure kprobe events of ftrace with "stacktrace" option enabled
in arm, there is no stacktrace was recorded after the kprobe event was
triggered. The root cause is no save_stack_trace_regs() function implemented.

Implement the save_stack_trace_regs() function in arm, then ftrace will
call this architecture-related function to record the stacktrace into
ring buffer.

After this fix, stacktrace can be recorded, for example:

 # mount -t debugfs nodev /sys/kernel/debug
 # echo "p:netrx net_rx_action" &gt;&gt; /sys/kernel/debug/tracing/kprobe_events
 # echo 1 &gt; /sys/kernel/debug/tracing/events/kprobes/netrx/enable
 # echo 1 &gt; /sys/kernel/debug/tracing/options/stacktrace
 # echo 1 &gt; /sys/kernel/debug/tracing/tracing_on
 # ping 127.0.0.1 -c 1
 # echo 0 &gt; /sys/kernel/debug/tracing/tracing_on

 # cat /sys/kernel/debug/tracing/trace
 # tracer: nop
 #
 # entries-in-buffer/entries-written: 12/12   #P:1
 #
 #                              _-----=&gt; irqs-off
 #                             / _----=&gt; need-resched
 #                            | / _---=&gt; hardirq/softirq
 #                            || / _--=&gt; preempt-depth
 #                            ||| /     delay
 #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
 #              | |       |   ||||       |         |
             &lt;------ missing some entries ----------------&gt;
             ping-1200  [000] dNs1   667.603250: netrx: (net_rx_action+0x0/0x1f8)
             ping-1200  [000] dNs1   667.604738: &lt;stack trace&gt;
  =&gt; net_rx_action
  =&gt; do_softirq
  =&gt; local_bh_enable
  =&gt; ip_finish_output
  =&gt; ip_output
  =&gt; ip_local_out
  =&gt; ip_send_skb
  =&gt; ip_push_pending_frames
  =&gt; raw_sendmsg
  =&gt; inet_sendmsg
  =&gt; sock_sendmsg
  =&gt; SyS_sendto
  =&gt; ret_fast_syscall

Signed-off-by: Lin Yongting &lt;linyongting@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: stacktrace: include exception PC value in stacktrace output</title>
<updated>2014-05-22T15:33:24+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2014-05-03T15:17:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=07b403415884e961920f55e6db462dff15d9df5a'/>
<id>07b403415884e961920f55e6db462dff15d9df5a</id>
<content type='text'>
When we unwind through an exception stack, include the saved PC value
into the stack trace: this fills in an otherwise missed functions from
the trace (as indicated below):

 [&lt;c03f4424&gt;] fec_enet_interrupt+0xa0/0xe8
 [&lt;c0066c0c&gt;] handle_irq_event_percpu+0x68/0x228
 [&lt;c0066e18&gt;] handle_irq_event+0x4c/0x6c
 [&lt;c006a024&gt;] handle_fasteoi_irq+0xac/0x198
 [&lt;c00664b0&gt;] generic_handle_irq+0x4c/0x60
 [&lt;c000f014&gt;] handle_IRQ+0x40/0x98
 [&lt;c0008554&gt;] gic_handle_irq+0x30/0x64
 [&lt;c0012900&gt;] __irq_svc+0x40/0x50
 [&lt;c0029030&gt;] __do_softirq+0xe0/0x2fc		&lt;====
 [&lt;c0029500&gt;] irq_exit+0xb0/0x100
 [&lt;c000f018&gt;] handle_IRQ+0x44/0x98
 [&lt;c0008554&gt;] gic_handle_irq+0x30/0x64
 [&lt;c0012900&gt;] __irq_svc+0x40/0x50
 [&lt;c000f34c&gt;] arch_cpu_idle+0x30/0x38		&lt;====
 [&lt;c005e1e4&gt;] cpu_startup_entry+0xac/0x214
 [&lt;c066297c&gt;] rest_init+0x68/0x80
 [&lt;c08ccb10&gt;] start_kernel+0x2fc/0x358

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we unwind through an exception stack, include the saved PC value
into the stack trace: this fills in an otherwise missed functions from
the trace (as indicated below):

 [&lt;c03f4424&gt;] fec_enet_interrupt+0xa0/0xe8
 [&lt;c0066c0c&gt;] handle_irq_event_percpu+0x68/0x228
 [&lt;c0066e18&gt;] handle_irq_event+0x4c/0x6c
 [&lt;c006a024&gt;] handle_fasteoi_irq+0xac/0x198
 [&lt;c00664b0&gt;] generic_handle_irq+0x4c/0x60
 [&lt;c000f014&gt;] handle_IRQ+0x40/0x98
 [&lt;c0008554&gt;] gic_handle_irq+0x30/0x64
 [&lt;c0012900&gt;] __irq_svc+0x40/0x50
 [&lt;c0029030&gt;] __do_softirq+0xe0/0x2fc		&lt;====
 [&lt;c0029500&gt;] irq_exit+0xb0/0x100
 [&lt;c000f018&gt;] handle_IRQ+0x44/0x98
 [&lt;c0008554&gt;] gic_handle_irq+0x30/0x64
 [&lt;c0012900&gt;] __irq_svc+0x40/0x50
 [&lt;c000f34c&gt;] arch_cpu_idle+0x30/0x38		&lt;====
 [&lt;c005e1e4&gt;] cpu_startup_entry+0xac/0x214
 [&lt;c066297c&gt;] rest_init+0x68/0x80
 [&lt;c08ccb10&gt;] start_kernel+0x2fc/0x358

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: stacktrace: avoid listing stacktrace functions in stacktrace</title>
<updated>2014-05-22T15:33:19+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2014-05-03T10:03:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3683f44c42e991d313dc301504ee0fca1aeb8580'/>
<id>3683f44c42e991d313dc301504ee0fca1aeb8580</id>
<content type='text'>
While debugging the FEC ethernet driver using stacktrace, it was noticed
that the stacktraces always begin as follows:

 [&lt;c00117b4&gt;] save_stack_trace_tsk+0x0/0x98
 [&lt;c0011870&gt;] save_stack_trace+0x24/0x28
 ...

This is because the stack trace code includes the stack frames for itself.
This is incorrect behaviour, and also leads to "skip" doing the wrong
thing (which is the number of stack frames to avoid recording.)

Perversely, it does the right thing when passed a non-current thread.  Fix
this by ensuring that we have a known constant number of frames above the
main stack trace function, and always skip these.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While debugging the FEC ethernet driver using stacktrace, it was noticed
that the stacktraces always begin as follows:

 [&lt;c00117b4&gt;] save_stack_trace_tsk+0x0/0x98
 [&lt;c0011870&gt;] save_stack_trace+0x24/0x28
 ...

This is because the stack trace code includes the stack frames for itself.
This is incorrect behaviour, and also leads to "skip" doing the wrong
thing (which is the number of stack frames to avoid recording.)

Perversely, it does the right thing when passed a non-current thread.  Fix
this by ensuring that we have a known constant number of frames above the
main stack trace function, and always skip these.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
