Re: [PATCH] bpf: add diagnostics for rejected memory and map accesses
From: Alexei Starovoitov
Date: Thu Sep 24 2026 - 21:42:29 EST
On Tue, Sep 22, 2026 at 11:19 AM Suchit Karunakaran <suchitkarunakaran@xxxxxxxxx> wrote:
> Hi Alexei, thanks for the review. After some research, I found that
> the sign extending load instruction was introduced in BPF ISA V4.
> Given that, would the following diagnostic message be more helpful for
> users?
> bpf_diag_policy(env, i + delta,
> "sign-extending load from arena memory",
> "the current JIT backend doesn't implement sign-extending loads from
> arena memory",
> "Recompile the BPF program with Clang's -mcpu=v3 to avoid generating
> sign-extending load instructions.");
Yes. That's something the user can do.
But look at what bpf_diag_policy() prints with these strings:
The sign-extending load from arena memory is not allowed: the current
JIT backend doesn't implement sign-extending loads from arena memory.
The same thing twice.
The other messages in the patch need the same treatment.
Read every report the way the user will see it before sending v2.