All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v11 04/10] libbpf: Probe percpu data feature
Date: Fri, 7 Aug 2026 10:26:58 +0800	[thread overview]
Message-ID: <4411dd33-bc55-48cd-92f2-abdc2746bf64@linux.dev> (raw)
In-Reply-To: <20260806170543.EC13F1F00A3A@smtp.kernel.org>

On 7/8/26 01:05, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The newly added feature probe `FEAT_PERCPU_DATA` is never used to make capability decisions.
> --
> 
> --- Patch [4]: [PATCH bpf-next v11 04/10] libbpf: Probe percpu data feature ---
> commit 925264284b89c241360ff401bd914f9c19997613
> Author: Leon Hwang <leon.hwang@linux.dev>
> 
> libbpf: Probe percpu data feature
> 
> This commit adds a feature probe to detect if the kernel supports global
> percpu data. It aims to allow libbpf to fail predictably when this feature
> is unavailable on older kernels.
> 
>> diff --git a/tools/lib/bpf/features.c b/tools/lib/bpf/features.c
>> index b7e388f99d0bb..ef9581c113035 100644
>> --- a/tools/lib/bpf/features.c
>> +++ b/tools/lib/bpf/features.c
> [ ... ]
>> @@ -707,6 +739,9 @@ static struct kern_feature_desc {
>>  	[FEAT_BPF_SYSCALL_COMMON_ATTRS] = {
>>  		"BPF syscall common attributes support", probe_bpf_syscall_common_attrs,
>>  	},
>> +	[FEAT_PERCPU_DATA] = {
>> +		"kernel supports percpu data", probe_kern_percpu_data,
>> +	},
>>  };
> 
> [Severity: Medium]
> Are there any callers that actually query this new feature probe?
> 
> The commit message notes that libbpf can make capability decisions early
> and fail predictably when global percpu data is unavailable. However,
> FEAT_PERCPU_DATA appears to only be defined and registered, without being
> queried in the loader code.
> 
> Is there a missing update to the loader, perhaps using kernel_supports(),
> that checks this flag before attempting to load percpu global data?
> 

No. The loader checks this flag in the next commit. The selftests also
check this flag to decide whether to run.

Thanks,
Leon


  reply	other threads:[~2026-08-07  2:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 16:31 [PATCH bpf-next v11 00/10] bpf: Introduce global percpu data Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 01/10] bpf: Drop duplicate blank lines in kernel/bpf/ Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 02/10] bpf: Factor out check_map_mem_read helper in verifier Leon Hwang
2026-08-10 21:38   ` Eduard Zingerman
2026-08-06 16:31 ` [PATCH bpf-next v11 03/10] bpf: Introduce global percpu data Leon Hwang
2026-08-10 23:22   ` Eduard Zingerman
2026-08-11  4:16     ` Leon Hwang
2026-08-11  7:54       ` Eduard Zingerman
2026-08-06 16:31 ` [PATCH bpf-next v11 04/10] libbpf: Probe percpu data feature Leon Hwang
2026-08-06 17:05   ` sashiko-bot
2026-08-07  2:26     ` Leon Hwang [this message]
2026-08-06 16:31 ` [PATCH bpf-next v11 05/10] libbpf: Add support for global percpu data Leon Hwang
2026-08-06 16:57   ` sashiko-bot
2026-08-07  2:36     ` Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 06/10] bpftool: Generate skeleton " Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 07/10] selftests/bpf: Add tests to verify " Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 08/10] selftests/bpf: Test direct reading/writing read-only percpu_array map Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 09/10] selftests/bpf: Test verifier log for global percpu data Leon Hwang
2026-08-06 16:31 ` [PATCH bpf-next v11 10/10] selftests/bpf: Verify bpf_iter " Leon Hwang

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=4411dd33-bc55-48cd-92f2-abdc2746bf64@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.