[RFC/RFT 1/2] RISC-V: Implement ptrace regs and stack API

2018-11-13 Thread Patrick Stählin
Needed for kprobes support. Copied and adapted from arm64 code. Signed-off-by: Patrick Stählin --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/ptrace.h | 34 +++ arch/riscv/kernel/ptrace.c | 99 + 3 files changed, 134 insertions

[RFC/RFT 2/2] RISC-V: kprobes/kretprobe support

2018-11-13 Thread Patrick Stählin
there is no support yet for decoding those. The way forward should be to uncompress the instructions for simulation to reduce the number of instructions used to decode the immediate values on probe hit. Signed-off-by: Patrick Stählin --- arch/riscv/Kconfig| 5

[RFC/RFT 0/2] RISC-V: kprobes/kretprobe support

2018-11-13 Thread Patrick Stählin
S=y CONFIG_MODULES=y The CONFIG_FUNCTION_TRACER is not strictly needed but makes testing easier using debugfs. After that, any example documented in Documentation/trace/kprobetrace.rst should work. Patrick Stählin (2): RISC-V: Implement ptrace regs and stack API RISC-V: kprobes/kretprobe sup

[PATCH v2] RISC-V: recognize S/U mode bits in print_isa

2018-11-09 Thread Patrick Stählin
Removes the warning about an unsupported ISA when reading /proc/cpuinfo on QEMU. The "S" extension is not being returned as it is not accessible from userspace. Signed-off-by: Patrick Stählin --- arch/riscv/kernel/cpu.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-)

[PATCH] RISC-V: recognize S/U mode bits in print_isa

2018-11-09 Thread Patrick Stählin
Removes the warning about an unsupported ISA when reading /proc/cpuinfo on QEMU. Signed-off-by: Patrick Stählin --- arch/riscv/kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 3a5a2ee31547..4029c7e6872b