<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/arch/arm64/kernel/stacktrace.c, branch v5.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=v5.1</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=v5.1'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2019-03-19T14:55:10Z</updated>
<entry>
<title>arm64/stacktrace: Export save_stack_trace_regs()</title>
<updated>2019-03-19T14:55:10Z</updated>
<author>
<name>William Cohen</name>
<email>wcohen@redhat.com</email>
</author>
<published>2019-03-01T20:00:41Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=c82fd1e6bd55ecc001e610e5484e292a7d8a39fc'/>
<id>urn:sha1:c82fd1e6bd55ecc001e610e5484e292a7d8a39fc</id>
<content type='text'>
The ARM64 implements the save_stack_trace_regs function, but it is
unusable for any diagnostic tooling compiled as a kernel module due
the missing EXPORT_SYMBOL_GPL for the function.  Export
save_stack_trace_regs() to align with other architectures such as
s390, openrisc, and powerpc. This is similar to the ARM64 export of
save_stack_trace_tsk() added in git commit e27c7fa015d6.

Signed-off-by: William Cohen &lt;wcohen@redhat.com&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack</title>
<updated>2018-12-22T13:21:02Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-12-07T18:13:28Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a448276ce515c91cde4675be497364b91c764d95'/>
<id>urn:sha1:a448276ce515c91cde4675be497364b91c764d95</id>
<content type='text'>
The structure of the ret_stack array on the task struct is going to
change, and accessing it directly via the curr_ret_stack index will no
longer give the ret_stack entry that holds the return address. To access
that, architectures must now use ftrace_graph_get_ret_stack() to get the
associated ret_stack that matches the saved return address.

Cc: linux-arm-kernel@lists.infradead.org
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>arm64: function_graph: Remove use of FTRACE_NOTRACE_DEPTH</title>
<updated>2018-12-09T01:53:38Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-18T23:41:46Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=421d1069cd85f6fee9f36984a071a73b6a431f65'/>
<id>urn:sha1:421d1069cd85f6fee9f36984a071a73b6a431f65</id>
<content type='text'>
Functions in the set_graph_notrace no longer subtract FTRACE_NOTRACE_DEPTH
from curr_ret_stack, as that is now implemented via the trace_recursion
flags. Access to curr_ret_stack no longer needs to worry about checking for
this. curr_ret_stack is still initialized to -1, when there's not a shadow
stack allocated.

Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Reviewed-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>arm64: Add stack information to on_accessible_stack</title>
<updated>2018-07-26T10:36:07Z</updated>
<author>
<name>Laura Abbott</name>
<email>labbott@redhat.com</email>
</author>
<published>2018-07-20T21:41:53Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8a1ccfbc9e0256baafbbce85ccdb72ec89af2aab'/>
<id>urn:sha1:8a1ccfbc9e0256baafbbce85ccdb72ec89af2aab</id>
<content type='text'>
In preparation for enabling the stackleak plugin on arm64,
we need a way to get the bounds of the current stack. Extend
on_accessible_stack to get this information.

Acked-by: Alexander Popov &lt;alex.popov@linux.com&gt;
Reviewed-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Signed-off-by: Laura Abbott &lt;labbott@redhat.com&gt;
[will: folded in fix for allmodconfig build breakage w/ sdei]
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>Revert "arm64: fix infinite stacktrace"</title>
<updated>2018-07-12T10:37:40Z</updated>
<author>
<name>Will Deacon</name>
<email>will.deacon@arm.com</email>
</author>
<published>2018-07-12T10:37:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e87a4a92fba3721eb06ba8d061b550e09e3d063a'/>
<id>urn:sha1:e87a4a92fba3721eb06ba8d061b550e09e3d063a</id>
<content type='text'>
This reverts commit 7e7df71fd57ff2894d96abb0080922bf39460a79.

When unwinding out of the IRQ stack and onto the interrupted EL1 stack,
we cannot rely on the frame pointer being strictly increasing, as this
could terminate the backtrace early depending on how the stacks have
been allocated.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>arm64: fix infinite stacktrace</title>
<updated>2018-07-04T17:34:23Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2018-06-14T18:58:21Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7e7df71fd57ff2894d96abb0080922bf39460a79'/>
<id>urn:sha1:7e7df71fd57ff2894d96abb0080922bf39460a79</id>
<content type='text'>
I've got this infinite stacktrace when debugging another problem:
[  908.795225] INFO: rcu_preempt detected stalls on CPUs/tasks:
[  908.796176]  1-...!: (1 GPs behind) idle=952/1/4611686018427387904 softirq=1462/1462 fqs=355
[  908.797692]  2-...!: (1 GPs behind) idle=f42/1/4611686018427387904 softirq=1550/1551 fqs=355
[  908.799189]  (detected by 0, t=2109 jiffies, g=130, c=129, q=235)
[  908.800284] Task dump for CPU 1:
[  908.800871] kworker/1:1     R  running task        0    32      2 0x00000022
[  908.802127] Workqueue: writecache-writeabck writecache_writeback [dm_writecache]
[  908.820285] Call trace:
[  908.824785]  __switch_to+0x68/0x90
[  908.837661]  0xfffffe00603afd90
[  908.844119]  0xfffffe00603afd90
[  908.850091]  0xfffffe00603afd90
[  908.854285]  0xfffffe00603afd90
[  908.863538]  0xfffffe00603afd90
[  908.865523]  0xfffffe00603afd90

The machine just locked up and kept on printing the same line over and
over again. This patch fixes it.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>arm64: fix unwind_frame() for filtered out fn for function graph tracing</title>
<updated>2018-02-23T13:46:38Z</updated>
<author>
<name>Pratyush Anand</name>
<email>panand@redhat.com</email>
</author>
<published>2018-02-05T13:28:01Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=9f416319f40cd857d2bb517630e5855a905ef3fb'/>
<id>urn:sha1:9f416319f40cd857d2bb517630e5855a905ef3fb</id>
<content type='text'>
do_task_stat() calls get_wchan(), which further does unwind_frame().
unwind_frame() restores frame-&gt;pc to original value in case function
graph tracer has modified a return address (LR) in a stack frame to hook
a function return. However, if function graph tracer has hit a filtered
function, then we can't unwind it as ftrace_push_return_trace() has
biased the index(frame-&gt;graph) with a 'huge negative'
offset(-FTRACE_NOTRACE_DEPTH).

Moreover, arm64 stack walker defines index(frame-&gt;graph) as unsigned
int, which can not compare a -ve number.

Similar problem we can have with calling of walk_stackframe() from
save_stack_trace_tsk() or dump_backtrace().

This patch fixes unwind_frame() to test the index for -ve value and
restore index accordingly before we can restore frame-&gt;pc.

Reproducer:

cd /sys/kernel/debug/tracing/
echo schedule &gt; set_graph_notrace
echo 1 &gt; options/display-graph
echo wakeup &gt; current_tracer
ps -ef | grep -i agent

Above commands result in:
Unable to handle kernel paging request at virtual address ffff801bd3d1e000
pgd = ffff8003cbe97c00
[ffff801bd3d1e000] *pgd=0000000000000000, *pud=0000000000000000
Internal error: Oops: 96000006 [#1] SMP
[...]
CPU: 5 PID: 11696 Comm: ps Not tainted 4.11.0+ #33
[...]
task: ffff8003c21ba000 task.stack: ffff8003cc6c0000
PC is at unwind_frame+0x12c/0x180
LR is at get_wchan+0xd4/0x134
pc : [&lt;ffff00000808892c&gt;] lr : [&lt;ffff0000080860b8&gt;] pstate: 60000145
sp : ffff8003cc6c3ab0
x29: ffff8003cc6c3ab0 x28: 0000000000000001
x27: 0000000000000026 x26: 0000000000000026
x25: 00000000000012d8 x24: 0000000000000000
x23: ffff8003c1c04000 x22: ffff000008c83000
x21: ffff8003c1c00000 x20: 000000000000000f
x19: ffff8003c1bc0000 x18: 0000fffffc593690
x17: 0000000000000000 x16: 0000000000000001
x15: 0000b855670e2b60 x14: 0003e97f22cf1d0f
x13: 0000000000000001 x12: 0000000000000000
x11: 00000000e8f4883e x10: 0000000154f47ec8
x9 : 0000000070f367c0 x8 : 0000000000000000
x7 : 00008003f7290000 x6 : 0000000000000018
x5 : 0000000000000000 x4 : ffff8003c1c03cb0
x3 : ffff8003c1c03ca0 x2 : 00000017ffe80000
x1 : ffff8003cc6c3af8 x0 : ffff8003d3e9e000

Process ps (pid: 11696, stack limit = 0xffff8003cc6c0000)
Stack: (0xffff8003cc6c3ab0 to 0xffff8003cc6c4000)
[...]
[&lt;ffff00000808892c&gt;] unwind_frame+0x12c/0x180
[&lt;ffff000008305008&gt;] do_task_stat+0x864/0x870
[&lt;ffff000008305c44&gt;] proc_tgid_stat+0x3c/0x48
[&lt;ffff0000082fde0c&gt;] proc_single_show+0x5c/0xb8
[&lt;ffff0000082b27e0&gt;] seq_read+0x160/0x414
[&lt;ffff000008289e6c&gt;] __vfs_read+0x58/0x164
[&lt;ffff00000828b164&gt;] vfs_read+0x88/0x144
[&lt;ffff00000828c2e8&gt;] SyS_read+0x60/0xc0
[&lt;ffff0000080834a0&gt;] __sys_trace_return+0x0/0x4

Fixes: 20380bb390a4 (arm64: ftrace: fix a stack tracer's output under function graph tracer)
Signed-off-by: Pratyush Anand &lt;panand@redhat.com&gt;
Signed-off-by: Jerome Marchand &lt;jmarchan@redhat.com&gt;
[catalin.marinas@arm.com: replace WARN_ON with WARN_ON_ONCE]
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>arm64: stacktrace: avoid listing stacktrace functions in stacktrace</title>
<updated>2017-09-14T01:53:16Z</updated>
<author>
<name>Prakash Gupta</name>
<email>guptap@codeaurora.org</email>
</author>
<published>2017-09-13T23:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=bb53c820c5b0f1a52804e32683aa7874db27392d'/>
<id>urn:sha1:bb53c820c5b0f1a52804e32683aa7874db27392d</id>
<content type='text'>
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.

This was fixed for arch arm by commit 3683f44c42e9 ("ARM: stacktrace:
avoid listing stacktrace functions in stacktrace")

Link: http://lkml.kernel.org/r/1504078343-28754-1-git-send-email-guptap@codeaurora.org
Signed-off-by: Prakash Gupta &lt;guptap@codeaurora.org&gt;
Cc: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>arm64: add on_accessible_stack()</title>
<updated>2017-08-15T17:36:12Z</updated>
<author>
<name>Mark Rutland</name>
<email>mark.rutland@arm.com</email>
</author>
<published>2017-08-01T17:51:15Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=12964443e8d1914010f9269f9f9abc4e122bc6ca'/>
<id>urn:sha1:12964443e8d1914010f9269f9f9abc4e122bc6ca</id>
<content type='text'>
Both unwind_frame() and dump_backtrace() try to check whether a stack
address is sane to access, with very similar logic. Both will need
updating in order to handle overflow stacks.

Factor out this logic into a helper, so that we can avoid further
duplication when we add overflow stacks.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Reviewed-by: Will Deacon &lt;will.deacon@arm.com&gt;
Tested-by: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: James Morse &lt;james.morse@arm.com&gt;
</content>
</entry>
<entry>
<title>arm64: unwind: remove sp from struct stackframe</title>
<updated>2017-08-09T13:10:29Z</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ard.biesheuvel@linaro.org</email>
</author>
<published>2017-07-23T08:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=31e43ad3b74a5d7b282023b72f25fc677c14c727'/>
<id>urn:sha1:31e43ad3b74a5d7b282023b72f25fc677c14c727</id>
<content type='text'>
The unwind code sets the sp member of struct stackframe to
'frame pointer + 0x10' unconditionally, without regard for whether
doing so produces a legal value. So let's simply remove it now that
we have stopped using it anyway.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: James Morse &lt;james.morse@arm.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
</feed>
