[PATCH v2 2/2] riscv: probes: reject probes inside an LR/SC sequence

Nam Cao namcao at linutronix.de
Wed Nov 11 23:54:49 PST 2026


Vladimir Kondratiev <vladimir.kondratiev at mobileye.com> writes:
> A kprobe or uprobe replaces an instruction with a breakpoint. The trap
> clears the hart's reservation, so if the breakpoint sits on the lr, on
> the sc, or on any instruction between them, the sc fails, the loop
> branches back to the lr and the probe fires again. The sequence never
> completes.

Xiaofeng sent a series addressing the same issue:
https://lore.kernel.org/linux-riscv/20261019134121.1763-1-yuanxiaofeng@eswincomputing.com/#t

I have only skimmed this patch, but this patch has an important
difference: riscv_probe_in_lrsc_body(), while the other series
implements a kunit.

Perhaps you two should join forces?

Nam



More information about the linux-riscv mailing list