summaryrefslogtreecommitdiffstats
path: root/arch/riscv/kernel/probes/simulate-insn.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-01-27 12:52:45 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-01-27 12:52:45 -0800
commitdb7c4673bbd30e54e28a3274dd50fe6a5e28a8b8 (patch)
tree31440fba218d45e6ca4277cd7d1482d0483517ad /arch/riscv/kernel/probes/simulate-insn.c
parente5eb2b22f0f4a1f0b98bc9b7efb352b0841a3bd2 (diff)
parentc1d6105869464635d8a2bcf87a43c05f4c0cfca4 (diff)
downloadlinux-db7c4673bbd30e54e28a3274dd50fe6a5e28a8b8.tar.bz2
Merge tag 'riscv-for-linus-6.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - A few DT bindings fixes to more closely align the ISA string requirements between the bindings and the ISA manual. - A handful of build error/warning fixes. - A fix to move init_cpu_topology() later in the boot flow, so it can allocate memory. - The IRC channel is now in the MAINTAINERS file, so it's easier to find. * tag 'riscv-for-linus-6.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Move call to init_cpu_topology() to later initialization stage riscv/kprobe: Fix instruction simulation of JALR riscv: fix -Wundef warning for CONFIG_RISCV_BOOT_SPINWAIT MAINTAINERS: add an IRC entry for RISC-V RISC-V: fix compile error from deduplicated __ALTERNATIVE_CFG_2 dt-bindings: riscv: fix single letter canonical order dt-bindings: riscv: fix underscore requirement for multi-letter extensions
Diffstat (limited to 'arch/riscv/kernel/probes/simulate-insn.c')
-rw-r--r--arch/riscv/kernel/probes/simulate-insn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/kernel/probes/simulate-insn.c b/arch/riscv/kernel/probes/simulate-insn.c
index d73e96f6ed7c..a20568bd1f1a 100644
--- a/arch/riscv/kernel/probes/simulate-insn.c
+++ b/arch/riscv/kernel/probes/simulate-insn.c
@@ -71,11 +71,11 @@ bool __kprobes simulate_jalr(u32 opcode, unsigned long addr, struct pt_regs *reg
u32 rd_index = (opcode >> 7) & 0x1f;
u32 rs1_index = (opcode >> 15) & 0x1f;
- ret = rv_insn_reg_set_val(regs, rd_index, addr + 4);
+ ret = rv_insn_reg_get_val(regs, rs1_index, &base_addr);
if (!ret)
return ret;
- ret = rv_insn_reg_get_val(regs, rs1_index, &base_addr);
+ ret = rv_insn_reg_set_val(regs, rd_index, addr + 4);
if (!ret)
return ret;