<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel/ftrace.c, branch linux-5.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-10-01T15:36:24Z</updated>
<entry>
<title>RISC-V: Take text_mutex in ftrace_init_nop()</title>
<updated>2020-10-01T15:36:24Z</updated>
<author>
<name>Palmer Dabbelt</name>
</author>
<published>2020-08-25T00:21:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af5681dfa0aaf4fc96f1bd1dfb00a39270107053'/>
<id>urn:sha1:af5681dfa0aaf4fc96f1bd1dfb00a39270107053</id>
<content type='text'>
[ Upstream commit 66d18dbda8469a944dfec6c49d26d5946efba218 ]

Without this we get lockdep failures.  They're spurious failures as SMP isn't
up when ftrace_init_nop() is called.  As far as I can tell the easiest fix is
to just take the lock, which also seems like the safest fix.

Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Acked-by: Guo Ren &lt;guoren@kernel.org&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault</title>
<updated>2020-06-17T17:57:41Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2020-06-17T07:37:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe557319aa06c23cffc9346000f119547e0f289a'/>
<id>urn:sha1:fe557319aa06c23cffc9346000f119547e0f289a</id>
<content type='text'>
Better describe what these functions do.

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>riscv: Use text_mutex instead of patch_lock</title>
<updated>2020-05-18T18:38:16Z</updated>
<author>
<name>Zong Li</name>
</author>
<published>2020-04-21T07:30:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6'/>
<id>urn:sha1:0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6</id>
<content type='text'>
We don't need the additional lock protection when patching the text.

There are two patching interfaces here:
 - patch_text: patch code and always synchronize with stop_machine()
 - patch_text_nosync: patch code without synchronization, it's caller's
                      responsibility to synchronize all CPUs if needed.

For the first one, stop_machine() is protected by its own mutex, and
also the irq is already disabled here.

For the second one, in risc-v real case now, it would be used to ftrace
patching the mcount function, since it already running under
kstop_machine(), no other thread will run, so we could use text_mutex
on ftrace side.

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Reviewed-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Reviewed-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Remove the 'riscv_' prefix of function name</title>
<updated>2020-05-18T18:38:13Z</updated>
<author>
<name>Zong Li</name>
</author>
<published>2020-04-21T07:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b80b3d582ebd8c7c49687319b3c624e03c4b2b93'/>
<id>urn:sha1:b80b3d582ebd8c7c49687319b3c624e03c4b2b93</id>
<content type='text'>
Refactor the function name by removing the 'riscv_' prefix, it would be
better unless it could mix up with arch-independent functions.

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Reviewed-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Reviewed-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: patch code by fixmap mapping</title>
<updated>2020-03-26T16:24:55Z</updated>
<author>
<name>Zong Li</name>
</author>
<published>2020-03-09T16:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2019-12-23T08:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2019-01-18T14:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2018-12-06T10:26:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2018-11-18T22:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2018-02-13T05:13:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</feed>
