From: Samuel Holland Date: Wed, 27 Mar 2024 16:04:42 +0000 (-0700) Subject: riscv: kprobes: Use patch_text_nosync() for insn slots X-Git-Tag: v6.11-rc1~94^2~11^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1756750a397f36ddc857989d31887c3f5081fb0;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20240327160520.791322-4-samuel.holland@sifive.com Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probes/kprobes.c index dfb28e57d9001..03cd103b84494 100644 --- a/arch/riscv/kernel/probes/kprobes.c +++ b/arch/riscv/kernel/probes/kprobes.c @@ -29,9 +29,8 @@ static void __kprobes arch_prepare_ss_slot(struct kprobe *p) p->ainsn.api.restore = (unsigned long)p->addr + offset; - patch_text(p->ainsn.api.insn, &p->opcode, 1); - patch_text((void *)((unsigned long)(p->ainsn.api.insn) + offset), - &insn, 1); + patch_text_nosync(p->ainsn.api.insn, &p->opcode, 1); + patch_text_nosync(p->ainsn.api.insn + offset, &insn, 1); } static void __kprobes arch_prepare_simulate(struct kprobe *p)