[PATCH bpf-next 08/10] riscv, bpf: Add ex_insn_off and ex_jmp_off for exception table handling

Björn Töpel bjorn at kernel.org
Mon Aug 4 23:22:41 PDT 2025


Pu Lehui <pulehui at huaweicloud.com> writes:

> From: Pu Lehui <pulehui at huawei.com>
>
> Add ex_insn_off and ex_jmp_off fields to struct rv_jit_context so that
> add_exception_handler() does not need to be immediately followed by the
> instruction to add the exception table. ex_insn_off indicates the offset
> of the instruction to add the exception table, and ex_jmp_off indicates
> the offset to jump over the faulting instruction. This is to prepare for
> adding the exception table to atomic instructions later, because some
> atomic instructions need to perform zext or other operations.
>
> Signed-off-by: Pu Lehui <pulehui at huawei.com>

[...]

> @@ -748,7 +745,7 @@ static int add_exception_handler(const struct bpf_insn *insn,
>  	 * that may fault. The execution will jump to this after handling the
>  	 * fault.
>  	 */

Nit: After the upcoming change, the comment ^^^ is not entierly true.
Don't respin for this, but a follow up would be nice!

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



More information about the linux-riscv mailing list