mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
riscv: kprobes: allow writing to x0
Instructions can write to x0, so we should simulate these instructions
normally.
Currently, the kernel hangs if an instruction who writes to x0 is
simulated.
Fixes: c22b0bcb1d
("riscv: Add kprobes supported")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcaov@gmail.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Acked-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20230829182500.61875-1-namcaov@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
b701f9e726
commit
8cb22bec14
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ static inline bool rv_insn_reg_set_val(struct pt_regs *regs, u32 index,
|
||||||
unsigned long val)
|
unsigned long val)
|
||||||
{
|
{
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
return false;
|
return true;
|
||||||
else if (index <= 31)
|
else if (index <= 31)
|
||||||
*((unsigned long *)regs + index) = val;
|
*((unsigned long *)regs + index) = val;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue