Skip to content

Commit b175675

Browse files
SiFiveHollandpalmer-dabbelt
authored andcommitted
riscv: kprobes: Use patch_text_nosync() for insn slots
These instructions are not yet visible to the rest of the system, so there is no need to do the whole stop_machine() dance. Reviewed-by: Björn Töpel <bjorn@rivosinc.com> Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Link: https://lore.kernel.org/r/20240327160520.791322-4-samuel.holland@sifive.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 2aa30d1 commit b175675

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

arch/riscv/kernel/probes/kprobes.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ static void __kprobes arch_prepare_ss_slot(struct kprobe *p)
2929

3030
p->ainsn.api.restore = (unsigned long)p->addr + offset;
3131

32-
patch_text(p->ainsn.api.insn, &p->opcode, 1);
33-
patch_text((void *)((unsigned long)(p->ainsn.api.insn) + offset),
34-
&insn, 1);
32+
patch_text_nosync(p->ainsn.api.insn, &p->opcode, 1);
33+
patch_text_nosync(p->ainsn.api.insn + offset, &insn, 1);
3534
}
3635

3736
static void __kprobes arch_prepare_simulate(struct kprobe *p)

0 commit comments

Comments
 (0)