<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel/traps.c, branch linux-5.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-10T23:16:06Z</updated>
<entry>
<title>riscv: xip: support runtime trap patching</title>
<updated>2021-06-10T23:16:06Z</updated>
<author>
<name>Vitaly Wool</name>
</author>
<published>2021-05-31T08:53:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e63215c2f64079fbd011df5005c8bea63f149c2'/>
<id>urn:sha1:5e63215c2f64079fbd011df5005c8bea63f149c2</id>
<content type='text'>
RISCV_ERRATA_ALTERNATIVE patches text at runtime which is currently
not possible when the kernel is executed from the flash in XIP mode.
Since runtime patching concerns only traps at the moment, let's just
have all the traps reside in RAM anyway if RISCV_ERRATA_ALTERNATIVE
is set. Thus, these functions will be patch-able even when the .text
section is in flash.

Signed-off-by: Vitaly Wool &lt;vitaly.wool@konsulko.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: remove unused handle_exception symbol</title>
<updated>2021-05-06T16:40:16Z</updated>
<author>
<name>Rouven Czerwinski</name>
</author>
<published>2021-05-01T18:53:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=beaf5ae15a13d835a01e30c282c8325ce0f1eb7e'/>
<id>urn:sha1:beaf5ae15a13d835a01e30c282c8325ce0f1eb7e</id>
<content type='text'>
Since commit 79b1feba5455 ("RISC-V: Setup exception vector early")
exception vectors are setup early and the handle_exception symbol from
the asm files is no longer referenced in traps.c. Remove it.

Signed-off-by: Rouven Czerwinski &lt;rouven@czerwinskis.de&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'riscv-for-linus-5.13-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux</title>
<updated>2021-05-06T16:24:18Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2021-05-06T16:24:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=939b7cbc00906b02c6eae6a380ad6c24c7a1e043'/>
<id>urn:sha1:939b7cbc00906b02c6eae6a380ad6c24c7a1e043</id>
<content type='text'>
Pull RISC-V updates from Palmer Dabbelt:

 - Support for the memtest= kernel command-line argument.

 - Support for building the kernel with FORTIFY_SOURCE.

 - Support for generic clockevent broadcasts.

 - Support for the buildtar build target.

 - Some build system cleanups to pass more LLVM-friendly arguments.

 - Support for kprobes.

 - A rearranged kernel memory map, the first part of supporting sv48
   systems.

 - Improvements to kexec, along with support for kdump and crash
   kernels.

 - An alternatives-based errata framework, along with support for
   handling a pair of errata that manifest on some SiFive designs
   (including the HiFive Unmatched).

 - Support for XIP.

 - A device tree for the Microchip PolarFire ICICLE SoC and associated
   dev board.

... along with a bunch of cleanups.  There are already a handful of fixes
on the list so there will likely be a part 2.

* tag 'riscv-for-linus-5.13-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (45 commits)
  RISC-V: Always define XIP_FIXUP
  riscv: Remove 32b kernel mapping from page table dump
  riscv: Fix 32b kernel build with CONFIG_DEBUG_VIRTUAL=y
  RISC-V: Fix error code returned by riscv_hartid_to_cpuid()
  RISC-V: Enable Microchip PolarFire ICICLE SoC
  RISC-V: Initial DTS for Microchip ICICLE board
  dt-bindings: riscv: microchip: Add YAML documentation for the PolarFire SoC
  RISC-V: Add Microchip PolarFire SoC kconfig option
  RISC-V: enable XIP
  RISC-V: Add crash kernel support
  RISC-V: Add kdump support
  RISC-V: Improve init_resources()
  RISC-V: Add kexec support
  RISC-V: Add EM_RISCV to kexec UAPI header
  riscv: vdso: fix and clean-up Makefile
  riscv/mm: Use BUG_ON instead of if condition followed by BUG.
  riscv/kprobe: fix kernel panic when invoking sys_read traced by kprobe
  riscv: Set ARCH_HAS_STRICT_MODULE_RWX if MMU
  riscv: module: Create module allocations without exec permissions
  riscv: bpf: Avoid breaking W^X
  ...
</content>
</entry>
<entry>
<title>riscv: add __init section marker to some functions</title>
<updated>2021-04-26T15:25:07Z</updated>
<author>
<name>Jisheng Zhang</name>
</author>
<published>2021-03-29T18:22:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1987501b1130c6b4b7e1cef4b9c1dc9a8adae025'/>
<id>urn:sha1:1987501b1130c6b4b7e1cef4b9c1dc9a8adae025</id>
<content type='text'>
They are not needed after booting, so mark them as __init to move them
to the __init section.

Signed-off-by: Jisheng Zhang &lt;jszhang@kernel.org&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: add do_page_fault and do_trap_break into the kprobes blacklist</title>
<updated>2021-04-16T04:32:28Z</updated>
<author>
<name>Jisheng Zhang</name>
</author>
<published>2021-03-29T18:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2349a3b26e29b8d860466bafda2e02b4b87a9e40'/>
<id>urn:sha1:2349a3b26e29b8d860466bafda2e02b4b87a9e40</id>
<content type='text'>
These two functions are used to implement the kprobes feature so they
can't be kprobed.

Fixes: c22b0bcb1dd0 ("riscv: Add kprobes supported")
Cc: stable@vger.kernel.org
Signed-off-by: Jisheng Zhang &lt;jszhang@kernel.org&gt;
Reviewed-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: traps: Fix no prototype warnings</title>
<updated>2021-03-10T04:45:51Z</updated>
<author>
<name>Nanyong Sun</name>
</author>
<published>2021-03-05T11:33:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=030f1dfa855054db5d845eca7f04c8cfda1c9f51'/>
<id>urn:sha1:030f1dfa855054db5d845eca7f04c8cfda1c9f51</id>
<content type='text'>
Fix all W=1 compilation warnings:'no previous prototype for' in arch/riscv/kernel/traps.c:
arch/riscv/kernel/traps.c:96:15: warning: no previous prototype for ‘do_trap_unknown’ [-Wmissing-prototypes]
   96 | DO_ERROR_INFO(do_trap_unknown,
      |               ^~~~~~~~~~~~~~~
arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
   91 | asmlinkage __visible void name(struct pt_regs *regs)   \
      |                           ^~~~
arch/riscv/kernel/traps.c:98:15: warning: no previous prototype for ‘do_trap_insn_misaligned’ [-Wmissing-prototypes]
   98 | DO_ERROR_INFO(do_trap_insn_misaligned,
      |               ^~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/traps.c:91:27: note: in definition of macro ‘DO_ERROR_INFO’
   91 | asmlinkage __visible void name(struct pt_regs *regs)   \
      |                           ^~~~
arch/riscv/kernel/traps.c:100:15: warning: no previous prototype for ‘do_trap_insn_fault’ [-Wmissing-prototypes]
...

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Nanyong Sun &lt;sunnanyong@huawei.com&gt;
[Palmer: fix checkpatch warnings]
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Add dump stack in show_regs</title>
<updated>2021-01-14T23:09:11Z</updated>
<author>
<name>Kefeng Wang</name>
</author>
<published>2021-01-11T12:40:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=091b9450858ecd60eeb5a14231db07071d24875f'/>
<id>urn:sha1:091b9450858ecd60eeb5a14231db07071d24875f</id>
<content type='text'>
Like commit 1149aad10b1e ("arm64: Add dump_backtrace() in show_regs"),
dump the stack in riscv show_regs as common code expects.

Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Add uprobes supported</title>
<updated>2021-01-14T23:09:08Z</updated>
<author>
<name>Guo Ren</name>
</author>
<published>2020-12-17T16:01:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74784081aac8a0f3636965fc230e2d3b7cc123c6'/>
<id>urn:sha1:74784081aac8a0f3636965fc230e2d3b7cc123c6</id>
<content type='text'>
This patch adds support for uprobes on riscv architecture.

Just like kprobe, it support single-step and simulate instructions.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Cc: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Add kprobes supported</title>
<updated>2021-01-14T23:09:06Z</updated>
<author>
<name>Guo Ren</name>
</author>
<published>2020-12-17T16:01:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c22b0bcb1dd024cb9caad9230e3a387d8b061df5'/>
<id>urn:sha1:c22b0bcb1dd024cb9caad9230e3a387d8b061df5</id>
<content type='text'>
This patch enables "kprobe &amp; kretprobe" to work with ftrace
interface. It utilized software breakpoint as single-step
mechanism.

Some instructions which can't be single-step executed must be
simulated in kernel execution slot, such as: branch, jal, auipc,
la ...

Some instructions should be rejected for probing and we use a
blacklist to filter, such as: ecall, ebreak, ...

We use ebreak &amp; c.ebreak to replace origin instruction and the
kprobe handler prepares an executable memory slot for out-of-line
execution with a copy of the original instruction being probed.
In execution slot we add ebreak behind original instruction to
simulate a single-setp mechanism.

The patch is based on packi's work [1] and csky's work [2].
 - The kprobes_trampoline.S is all from packi's patch
 - The single-step mechanism is new designed for riscv without hw
   single-step trap
 - The simulation codes are from csky
 - Frankly, all codes refer to other archs' implementation

 [1] https://lore.kernel.org/linux-riscv/20181113195804.22825-1-me@packi.ch/
 [2] https://lore.kernel.org/linux-csky/20200403044150.20562-9-guoren@kernel.org/

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Co-developed-by: Patrick Stählin &lt;me@packi.ch&gt;
Signed-off-by: Patrick Stählin &lt;me@packi.ch&gt;
Acked-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Tested-by: Zong Li &lt;zong.li@sifive.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Patrick Stählin &lt;me@packi.ch&gt;
Cc: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Cc: Björn Töpel &lt;bjorn.topel@gmail.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: Setup exception vector early</title>
<updated>2020-07-30T18:37:48Z</updated>
<author>
<name>Atish Patra</name>
</author>
<published>2020-07-15T23:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79b1feba54558bfb7df7c516dab29a7c9dba093c'/>
<id>urn:sha1:79b1feba54558bfb7df7c516dab29a7c9dba093c</id>
<content type='text'>
The trap vector is set only in trap_init which may be too late in some
cases. Early ioremap/efi spits many warning messages which may be useful.

Setup the trap vector early so that any warning/bug can be handled before
generic code invokes trap_init.

Signed-off-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
</feed>
