Re: [PATCH v4 2/4] LoongArch: bpf: Advertise JIT support for kptr xchg inline

Hengqi Chen <[email protected]>
Newsgroups dev.linux.lists.loongarch,org.kernel.vger.bpf,org.kernel.vger.linux-kselftest
Message-ID <CAEyhmHQOGZGJbdx21mBtZ7aNM8ZDnYTgCtLWHQ4pXy3jVcG3Ng@mail.gmail.com>
On Wed, Jul 29, 2026 at 10:30 AM Chenguang Zhao
<[email protected]> wrote:
>
> From: Chenguang Zhao <[email protected]>
>
> The BPF verifier can lower bpf_kptr_xchg() to BPF_XCHG when the JIT
> advertises ptr xchg support. With ordered amswap_db.* emission from the
> previous patch, declare that LoongArch bpf JIT supports this inlining.
>

Acked-by: Hengqi Chen <[email protected]>

> Signed-off-by: Chenguang Zhao <[email protected]>
> ---
>  arch/loongarch/net/bpf_jit.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c
> index 5417a5624327..686d333146ce 100644
> --- a/arch/loongarch/net/bpf_jit.c
> +++ b/arch/loongarch/net/bpf_jit.c
> @@ -2396,6 +2396,11 @@ bool bpf_jit_supports_fsession(void)
>         return true;
>  }
>
> +bool bpf_jit_supports_ptr_xchg(void)
> +{
> +       return true;
> +}
> +
>  /* Indicate the JIT backend supports mixing bpf2bpf and tailcalls. */
>  bool bpf_jit_supports_subprog_tailcalls(void)
>  {
> --
> 2.25.1
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.