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 <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 2aa30d1 commit b175675

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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)