[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAN+4W8iDy8w=aVErrSKA1OqJ7Onv3eszYOKHLr+zucfHRuHsVg@mail.gmail.com>
Date: Thu, 18 May 2023 09:42:28 +0100
From: Lorenz Bauer <lmb@...valent.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH bpf-next] bpf: btf: restore resolve_mode when popping the
resolve stack
On Thu, May 18, 2023 at 2:42 AM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> On 5/17/23 2:01 AM, Lorenz Bauer wrote:
> > On Wed, May 17, 2023 at 7:26 AM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> I can see your point to refactor it to make it work for all different BTF_KIND.
>
> Other than BTF_KIND_DATASEC, env->resolve_mode stays the same for all other
> kinds once it is decided. It is why resolve_mode is in the "env" instead of "v".
> My concern is this will hide some bugs (existing or future) that accidentally
> changed the resolve_mode in the middle. If there is another legit case that
> could be found other than BTF_KIND_DATASEC, that will be a better time to do
> this refactoring with a proper test case considering most bpf progs need btf to
> load nowadays and probably need to veristat test also. If it came to that, might
> as well consider moving resolve_mode from "env" to "v".
>
> btf_datasec_resolve() is acting as a very top level resolver like btf_resolve(),
> so it reset env->resolve_mode before resolving its var member like how
> btf_resolve() does. imo, together with env->resolve_mode stays the same for
> others, it is more straight forward to reason. I understand that it is personal
> preference and could argue either way.
Okay, let's drop it then :)
Powered by blists - more mailing lists