<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/arch/riscv/kernel/ftrace.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/arch/riscv/kernel/ftrace.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/arch/riscv/kernel/ftrace.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-03-26T16:24:55Z</updated>
<entry>
<title>riscv: patch code by fixmap mapping</title>
<updated>2020-03-26T16:24:55Z</updated>
<author>
<name>Zong Li</name>
<email>zong.li@sifive.com</email>
</author>
<published>2020-03-09T16:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8fdddb2eae731dd6beb89f9b812e5915d1beb744'/>
<id>urn:sha1:8fdddb2eae731dd6beb89f9b812e5915d1beb744</id>
<content type='text'>
On strict kernel memory permission, the ftrace have to change the
permission of text for dynamic patching the intructions. Use
riscv_patch_text_nosync() to patch code instead of probe_kernel_write.

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: ftrace: correct the condition logic in function graph tracer</title>
<updated>2020-01-03T08:56:37Z</updated>
<author>
<name>Zong Li</name>
<email>zong.li@sifive.com</email>
</author>
<published>2019-12-23T08:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1d8f65798240b6577d8c44d20c8ea8f1d429e495'/>
<id>urn:sha1:1d8f65798240b6577d8c44d20c8ea8f1d429e495</id>
<content type='text'>
The condition should be logical NOT to assign the hook address to parent
address. Because the return value 0 of function_graph_enter upon
success.

Fixes: e949b6db51dc (riscv/function_graph: Simplify with function_graph_enter())
Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Reviewed-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: add missing newlines to printk messages</title>
<updated>2019-02-11T23:34:56Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2019-01-18T14:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7265d103902c0bc2b76fe04e87e0c486016391c3'/>
<id>urn:sha1:7265d103902c0bc2b76fe04e87e0c486016391c3</id>
<content type='text'>
Add missing newline characters to printk messages.

Also replace two pr_warning with the shorter pr_warn, and fix up the
tense of one error message while at it.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv: remove unused variable in ftrace</title>
<updated>2018-12-21T16:11:26Z</updated>
<author>
<name>David Abdurachmanov</name>
<email>david.abdurachmanov@gmail.com</email>
</author>
<published>2018-12-06T10:26:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=397182e0db56b8894a43631ce72de14d90a29834'/>
<id>urn:sha1:397182e0db56b8894a43631ce72de14d90a29834</id>
<content type='text'>
Noticed while building kernel-4.20.0-0.rc5.git2.1.fc30 for
Fedora 30/RISCV.

[..]
BUILDSTDERR: arch/riscv/kernel/ftrace.c: In function 'prepare_ftrace_return':
BUILDSTDERR: arch/riscv/kernel/ftrace.c:135:6: warning: unused variable 'err' [-Wunused-variable]
BUILDSTDERR:   int err;
BUILDSTDERR:       ^~~
[..]

Signed-off-by: David Abdurachmanov &lt;david.abdurachmanov@gmail.com&gt;
Fixes: e949b6db51dc1 ("riscv/function_graph: Simplify with function_graph_enter()")
Reviewed-by: Olof Johansson &lt;olof@lixom.net&gt;
Acked-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv/function_graph: Simplify with function_graph_enter()</title>
<updated>2018-11-28T01:31:16Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-11-18T22:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=e949b6db51dc172a35c962bc4414ca148315fe21'/>
<id>urn:sha1:e949b6db51dc172a35c962bc4414ca148315fe21</id>
<content type='text'>
The function_graph_enter() function does the work of calling the function
graph hook function and the management of the shadow stack, simplifying the
work done in the architecture dependent prepare_ftrace_return().

Have riscv use the new code, and remove the shadow stack management as well as
having to set up the trace structure.

This is needed to prepare for a fix of a design bug on how the curr_ret_stack
is used.

Cc: Greentime Hu &lt;greentime@andestech.com&gt;
Cc: Alan Kao &lt;alankao@andestech.com&gt;
Cc: stable@kernel.org
Fixes: 03274a3ffb449 ("tracing/fgraph: Adjust fgraph depth before calling trace return callback")
Reviewed-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Reviewed-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support</title>
<updated>2018-04-03T02:59:13Z</updated>
<author>
<name>Alan Kao</name>
<email>alankao@andestech.com</email>
</author>
<published>2018-02-13T05:13:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=b785ec129bd9498ecd6e221e45820b00c6ed4adf'/>
<id>urn:sha1:b785ec129bd9498ecd6e221e45820b00c6ed4adf</id>
<content type='text'>
In walk_stackframe, the pc now receives the address from calling
ftrace_graph_ret_addr instead of manual calculation.

Note that the original calculation,
        pc = frame-&gt;ra - 4
is buggy when the instruction at the return address happened to be a
compressed inst. But since it is not a critical part of ftrace, it is
ignored for now to ease the review process.

Cc: Greentime Hu &lt;greentime@andestech.com&gt;
Signed-off-by: Alan Kao &lt;alankao@andestech.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv/ftrace: Add DYNAMIC_FTRACE_WITH_REGS support</title>
<updated>2018-04-03T02:59:13Z</updated>
<author>
<name>Alan Kao</name>
<email>alankao@andestech.com</email>
</author>
<published>2018-02-13T05:13:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=aea4c671fb985e6a9ffc365c43ea6f5e0d737fea'/>
<id>urn:sha1:aea4c671fb985e6a9ffc365c43ea6f5e0d737fea</id>
<content type='text'>
Cc: Greentime Hu &lt;greentime@andestech.com&gt;
Signed-off-by: Alan Kao &lt;alankao@andestech.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv/ftrace: Add dynamic function graph tracer support</title>
<updated>2018-04-03T02:59:12Z</updated>
<author>
<name>Alan Kao</name>
<email>alankao@andestech.com</email>
</author>
<published>2018-02-13T05:13:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=bc1a4c3a842556852bb02039887d73899d513532'/>
<id>urn:sha1:bc1a4c3a842556852bb02039887d73899d513532</id>
<content type='text'>
Once the function_graph tracer is enabled, a filtered function has the
following call sequence:

* ftracer_caller         ==&gt; on/off by ftrace_make_call/ftrace_make_nop
* ftrace_graph_caller
* ftrace_graph_call      ==&gt; on/off by ftrace_en/disable_ftrace_graph_caller
* prepare_ftrace_return

Considering the following DYNAMIC_FTRACE_WITH_REGS feature, it would be
more extendable to have a ftrace_graph_caller function, instead of
calling prepare_ftrace_return directly in ftrace_caller.

Cc: Greentime Hu &lt;greentime@andestech.com&gt;
Signed-off-by: Alan Kao &lt;alankao@andestech.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv/ftrace: Add dynamic function tracer support</title>
<updated>2018-04-03T02:59:12Z</updated>
<author>
<name>Alan Kao</name>
<email>alankao@andestech.com</email>
</author>
<published>2018-02-13T05:13:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c15ac4fd60d5ffdb151bb2c7805f377fd7f90363'/>
<id>urn:sha1:c15ac4fd60d5ffdb151bb2c7805f377fd7f90363</id>
<content type='text'>
We now have dynamic ftrace with the following added items:

* ftrace_make_call, ftrace_make_nop (in kernel/ftrace.c)
  The two functions turn each recorded call site of filtered functions
  into a call to ftrace_caller or nops

* ftracce_update_ftrace_func (in kernel/ftrace.c)
  turns the nops at ftrace_call into a call to a generic entry for
  function tracers.

* ftrace_caller (in kernel/mcount-dyn.S)
  The entry where each _mcount call sites calls to once they are
  filtered to be traced.

Also, this patch fixes the semantic problems in mcount.S, which will be
treated as only a reference implementation once we have the dynamic
ftrace.

Cc: Greentime Hu &lt;greentime@andestech.com&gt;
Signed-off-by: Alan Kao &lt;alankao@andestech.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv/ftrace: Add basic support</title>
<updated>2018-01-31T03:10:54Z</updated>
<author>
<name>Alan Kao</name>
<email>nonerkao@gmail.com</email>
</author>
<published>2017-12-18T09:52:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=10626c32e3827bca560217966f5bd586c4e91584'/>
<id>urn:sha1:10626c32e3827bca560217966f5bd586c4e91584</id>
<content type='text'>
This patch contains basic ftrace support for RV64I platform.
Specifically, function tracer (HAVE_FUNCTION_TRACER), function graph
tracer (HAVE_FUNCTION_GRAPH_TRACER), and a frame pointer test
(HAVE_FUNCTION_GRAPH_FP_TEST) are implemented following the
instructions in Documentation/trace/ftrace-design.txt.

Note that the functions in both ftrace.c and setup.c should not be
hooked with the compiler's -pg option: to prevent infinite self-
referencing for the former, and to ignore early setup stuff for the
latter.

Signed-off-by: Alan Kao &lt;alankao@andestech.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
</feed>
