From: Eduard Zingerman <eddyz87@gmail.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
Barret Rhoden <brho@google.com>,
Matt Bobrowski <mattbobrowski@google.com>,
kkd@meta.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next v1 08/11] bpf: Report arena faults to BPF stderr
Date: Fri, 09 May 2025 13:07:13 -0700 [thread overview]
Message-ID: <e78b2cf09f6931ec8e7791e35c8b49f19bf1d4b5.camel@gmail.com> (raw)
In-Reply-To: <CAP01T74uq5Uyy6VHXyA_yVeO9rdU7svnQv90Z7auerApjbRfQA@mail.gmail.com>
On Fri, 2025-05-09 at 22:01 +0200, Kumar Kartikeya Dwivedi wrote:
[...]
> > > bool ex_handler_bpf(const struct exception_table_entry *x, struct pt_regs *regs)
> > > {
> > > - u32 reg = x->fixup >> 8;
> > > + u32 arena_reg = (x->fixup >> 8) & 0xff;
> > > + bool is_arena = !!arena_reg;
> > > + u32 reg = x->fixup >> 16;
> > > + unsigned long addr;
> > > +
> > > + /* Read here, if src_reg is dst_reg for load, we'll write 0 to it. */
> > > + if (is_arena)
> > > + addr = *(unsigned long *)((void *)regs + arena_reg);
> >
> > Is it necessary to also take offset into account when calculating address?
> >
>
> Not sure what you mean? "arena_reg" is basically the offset of the
> register holding the arena address within pt_regs.
Arena access is translated as an instruction with three operands, e.g.:
`movzx <dst>, byte ptr [<src> + r12 + <off>]`
As far as I understand the code, currently `addr` takes into account
`<src>` value, but not the `<off>` value.
[...]
next prev parent reply other threads:[~2025-05-09 20:07 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 17:17 [PATCH bpf-next v1 00/11] BPF Standard Streams Kumar Kartikeya Dwivedi
2025-05-07 17:17 ` [PATCH bpf-next v1 01/11] bpf: Introduce bpf_dynptr_from_mem_slice Kumar Kartikeya Dwivedi
2025-05-09 17:19 ` Eduard Zingerman
2025-05-09 21:11 ` Andrii Nakryiko
2025-05-07 17:17 ` [PATCH bpf-next v1 02/11] bpf: Introduce BPF standard streams Kumar Kartikeya Dwivedi
2025-05-08 23:54 ` Eduard Zingerman
2025-05-09 0:10 ` Kumar Kartikeya Dwivedi
2025-05-07 17:17 ` [PATCH bpf-next v1 03/11] bpf: Add function to extract program source info Kumar Kartikeya Dwivedi
2025-05-08 10:30 ` kernel test robot
2025-05-08 20:15 ` Eduard Zingerman
2025-05-08 23:32 ` Kumar Kartikeya Dwivedi
2025-05-09 21:17 ` Andrii Nakryiko
2025-05-07 17:17 ` [PATCH bpf-next v1 04/11] bpf: Add function to find program from stack trace Kumar Kartikeya Dwivedi
2025-05-08 23:07 ` Eduard Zingerman
2025-05-08 23:29 ` Kumar Kartikeya Dwivedi
2025-05-07 17:17 ` [PATCH bpf-next v1 05/11] bpf: Add dump_stack() analogue to print to BPF stderr Kumar Kartikeya Dwivedi
2025-05-08 22:38 ` Eduard Zingerman
2025-05-08 23:29 ` Kumar Kartikeya Dwivedi
2025-05-07 17:17 ` [PATCH bpf-next v1 06/11] bpf: Report may_goto timeout " Kumar Kartikeya Dwivedi
2025-05-08 12:53 ` kernel test robot
2025-05-09 6:22 ` Eduard Zingerman
2025-05-09 9:19 ` Alan Maguire
2025-05-07 17:17 ` [PATCH bpf-next v1 07/11] bpf: Report rqspinlock deadlocks/timeout " Kumar Kartikeya Dwivedi
2025-05-07 17:17 ` [PATCH bpf-next v1 08/11] bpf: Report arena faults " Kumar Kartikeya Dwivedi
2025-05-09 19:28 ` Eduard Zingerman
2025-05-09 20:01 ` Kumar Kartikeya Dwivedi
2025-05-09 20:07 ` Eduard Zingerman [this message]
2025-05-09 20:10 ` Kumar Kartikeya Dwivedi
2025-05-09 20:17 ` Eduard Zingerman
2025-05-07 17:17 ` [PATCH bpf-next v1 09/11] libbpf: Add bpf_stream_printk() macro Kumar Kartikeya Dwivedi
2025-05-08 23:31 ` Eduard Zingerman
2025-05-08 23:33 ` Kumar Kartikeya Dwivedi
2025-05-09 6:16 ` Eduard Zingerman
2025-05-09 21:28 ` Andrii Nakryiko
2025-05-08 23:41 ` Alexei Starovoitov
2025-05-08 23:48 ` Kumar Kartikeya Dwivedi
2025-05-08 23:50 ` Kumar Kartikeya Dwivedi
2025-05-09 21:26 ` Andrii Nakryiko
2025-05-07 17:17 ` [PATCH bpf-next v1 10/11] bpftool: Add support for dumping streams Kumar Kartikeya Dwivedi
2025-05-08 10:41 ` Quentin Monnet
2025-05-08 23:41 ` Kumar Kartikeya Dwivedi
2025-05-09 6:21 ` Eduard Zingerman
2025-05-09 17:31 ` Alexei Starovoitov
2025-05-09 18:31 ` Eduard Zingerman
2025-05-09 18:48 ` Alexei Starovoitov
2025-05-09 19:37 ` Eduard Zingerman
2025-05-09 19:50 ` Kumar Kartikeya Dwivedi
2025-05-09 21:33 ` Andrii Nakryiko
2025-05-12 20:51 ` Kumar Kartikeya Dwivedi
2025-05-12 21:35 ` Andrii Nakryiko
2025-05-12 21:50 ` Alexei Starovoitov
2025-05-12 21:56 ` Kumar Kartikeya Dwivedi
2025-05-12 22:07 ` Alexei Starovoitov
2025-05-07 17:17 ` [PATCH bpf-next v1 11/11] selftests/bpf: Add tests for prog streams Kumar Kartikeya Dwivedi
2025-05-09 17:18 ` Eduard Zingerman
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=e78b2cf09f6931ec8e7791e35c8b49f19bf1d4b5.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brho@google.com \
--cc=daniel@iogearbox.net \
--cc=emil@etsalapatis.com \
--cc=kernel-team@meta.com \
--cc=kkd@meta.com \
--cc=martin.lau@kernel.org \
--cc=mattbobrowski@google.com \
--cc=memxor@gmail.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.