[PATCH] riscv: Fix text patching when icache flushes use IPIs

Björn Töpel bjorn at kernel.org
Tue Feb 6 23:30:58 PST 2024


Alexandre Ghiti <alexghiti at rivosinc.com> writes:

> For now, we use stop_machine() to patch the text and when we use IPIs for
> remote icache flushes, the system hangs since the irqs are disabled on all
> cpus.
>
> So instead, make sure every cpu executes the stop_machine() patching
> function which emits a local icache flush and then avoids the use of
> IPIs.
>
> Co-developed-by: Björn Töpel <bjorn at rivosinc.com>
> Signed-off-by: Björn Töpel <bjorn at rivosinc.com>
> Signed-off-by: Alexandre Ghiti <alexghiti at rivosinc.com>

FWIW, the BPF selftests pass nicely with this (especially the
fentry/fexit tests ;-)). I don't know if it's worth much saying that
your own stuff was tested, but here goes:

Tested-by: Björn Töpel <bjorn at rivosinc.com>



More information about the linux-riscv mailing list