From: Marat Khalili <marat.khalili@huawei.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
"Christophe Fontaine" <cfontain@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Konstantin Ananyev <konstantin.ananyev@huawei.com>,
Wathsala Vithanage <wathsala.vithanage@arm.com>
Subject: RE: [PATCH] bpf/arm64: support packet data load instructions
Date: Wed, 18 Mar 2026 16:43:46 +0000 [thread overview]
Message-ID: <ba8f317961494ce9af15a9108aa3693b@huawei.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35F657A1@smartserver.smartshare.dk>
> > I suggest the following logic in pseudo-code:
> >
> > static void
> > emit_ld_mbuf(struct a64_jit_ctx *ctx, uint32_t op, uint8_t tmp1,
> > uint8_t tmp2,
> > uint8_t src, int32_t imm)
> > {
> > // ...
> >
> > /* r1 = off: for ABS use imm, for IND use src + imm */
> > if (mode == BPF_ABS) {
> > assert imm >= 0, "verified by verifier"
> > emit MOV W1, #<imm>
> > } else {
> > /* add signed imm to the source register */
> > emit(s) X1 = src + #<imm>
> > /* verify dynamically that offset is within the domain of
> > __rte_pktmbuf_read */
> > emit(s) jump_to_epilogue if X1 <s 0 || X1 > INT32_MAX
> > }
> >
> > // ...
> > }
>
> I don't know if it's the sum of src+imm that determines special meaning, or it's the imm itself.
> If it's the imm itself, a simple fix would be to update the validator's .imm.max values for BPF_IND
> from UINT32_MAX to INT32_MAX.
>
Even if we do it (I have no particular opinion), it won't prevent sum of 64-bit
register and immediate from being negative or greater than the range of values
supported by 32-bit argument of __rte_pktmbuf_read.
next prev parent reply other threads:[~2026-03-18 16:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 12:20 [PATCH] bpf/arm64: support packet data load instructions Christophe Fontaine
2026-03-17 9:07 ` David Marchand
2026-03-18 11:59 ` Marat Khalili
2026-03-18 12:54 ` Morten Brørup
2026-03-18 13:07 ` Marat Khalili
2026-03-18 13:39 ` Morten Brørup
2026-03-18 15:34 ` Christophe Fontaine
2026-03-18 16:16 ` Marat Khalili
2026-03-18 16:37 ` Morten Brørup
2026-03-18 16:43 ` Marat Khalili [this message]
2026-03-18 18:10 ` Konstantin Ananyev
2026-03-19 9:20 ` Morten Brørup
2026-03-18 23:13 ` Stephen Hemminger
2026-03-19 11:44 ` [PATCH v2 0/2] " Christophe Fontaine
2026-03-19 11:44 ` [PATCH v2 1/2] bpf/arm64: fix offset type to allow a negative jump Christophe Fontaine
2026-03-19 11:44 ` [PATCH v2 2/2] bpf/arm64: support packet data load instructions Christophe Fontaine
2026-03-23 8:15 ` Christophe Fontaine
2026-03-23 9:26 ` Marat Khalili
2026-04-09 22:11 ` Wathsala Vithanage
2026-05-13 20:56 ` Christophe Fontaine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba8f317961494ce9af15a9108aa3693b@huawei.com \
--to=marat.khalili@huawei.com \
--cc=cfontain@redhat.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@huawei.com \
--cc=mb@smartsharesystems.com \
--cc=wathsala.vithanage@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.