From: Yonghong Song <yonghong.song@linux.dev>
To: Philo Lu <lulie@linux.alibaba.com>, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com,
andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com,
song@kernel.org, kpsingh@kernel.org, sdf@google.com,
haoluo@google.com, jolsa@kernel.org, mykolal@fb.com,
shuah@kernel.org, xuanzhuo@linux.alibaba.com
Subject: Re: [PATCH bpf-next v1 1/3] bpf: store both map ptr and state in bpf_insn_aux_data
Date: Fri, 5 Apr 2024 09:36:57 -0700 [thread overview]
Message-ID: <554a923f-3f3a-42e5-825a-7a563a2dbf0e@linux.dev> (raw)
In-Reply-To: <20240405025536.18113-2-lulie@linux.alibaba.com>
On 4/4/24 7:55 PM, Philo Lu wrote:
> Currently, bpf_insn_aux_data->map_ptr_state is used to store either
> map_ptr or its poison state (i.e., BPF_MAP_PTR_POISON). Thus
> BPF_MAP_PTR_POISON must be checked before reading map_ptr. In certain
> cases, we may need valid map_ptr even in case of poison state.
> This will be explained in next patch with bpf_for_each_map_elem()
> helper.
>
> This patch changes map_ptr_state into a new struct including both map
> pointer and its state (poison/unpriv). It's in the same union with
> struct bpf_loop_inline_state, so there is no extra memory overhead.
> Besides, macros BPF_MAP_PTR_UNPRIV/BPF_MAP_PTR_POISON/BPF_MAP_PTR are no
> longer needed.
>
> This patch does not change any existing functionality.
>
> Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
next prev parent reply other threads:[~2024-04-05 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 2:55 [PATCH bpf-next v1 0/3] bpf: allow bpf_for_each_map_elem() helper with different input maps Philo Lu
2024-04-05 2:55 ` [PATCH bpf-next v1 1/3] bpf: store both map ptr and state in bpf_insn_aux_data Philo Lu
2024-04-05 16:36 ` Yonghong Song [this message]
2024-04-05 2:55 ` [PATCH bpf-next v1 2/3] bpf: allow invoking bpf_for_each_map_elem with different maps Philo Lu
2024-04-05 16:37 ` Yonghong Song
2024-04-05 2:55 ` [PATCH bpf-next v1 3/3] selftests/bpf: add test for bpf_for_each_map_elem() " Philo Lu
2024-04-05 16:39 ` Yonghong Song
2024-04-05 17:35 ` Andrii Nakryiko
2024-04-05 17:41 ` Alexei Starovoitov
2024-04-05 17:52 ` Andrii Nakryiko
2024-04-05 17:40 ` [PATCH bpf-next v1 0/3] bpf: allow bpf_for_each_map_elem() helper with different input maps patchwork-bot+netdevbpf
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=554a923f-3f3a-42e5-825a-7a563a2dbf0e@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=lulie@linux.alibaba.com \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=xuanzhuo@linux.alibaba.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.