Skip to content

libbpf: Add gating for arena globals relocation feature#11014

Closed
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
series/1052850=>bpf-next
Closed

libbpf: Add gating for arena globals relocation feature#11014
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
series/1052850=>bpf-next

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: libbpf: Add gating for arena globals relocation feature
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1052850

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: db975de
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1052850
version: 4

@kernel-patches-review-bot
Copy link

commit 01bb8947298070a410abeb3e1ca805b5bc5a16b2
Author: Emil Tsalapatis <emil@etsalapatis.com>

libbpf: Add gating for arena globals relocation feature

This commit adds feature detection for the arena globals relocation that
was introduced in c1f61171d44b. The feature probe detects whether the
kernel includes 12a1fe6e12db which removed the 512 MiB offset limit.

> diff --git a/tools/lib/bpf/features.c b/tools/lib/bpf/features.c
> index b842b83e2480..9689e408ac58 100644
> --- a/tools/lib/bpf/features.c
> +++ b/tools/lib/bpf/features.c

[ ... ]

> @@ -581,6 +643,9 @@ static struct kern_feature_desc {
>  	[FEAT_BTF_QMARK_DATASEC] = {
>  		"BTF DATASEC names starting from '?'", probe_kern_btf_qmark_datasec,
>  	},
> +	[FEAT_LDIMM64_FULL_RANGE_OFF] = {
> +		"Full range LDIMM64 support", probe_ldimm64_full_range_off,
                 ^

Andrii requested in v3 review that the description should start with
lowercase since it appears mid-sentence in error messages like
"Detection of kernel %s support failed". Other feature descriptions
that don't start with acronyms use lowercase (e.g., "global variables",
"minimal BTF", "kernel-side __arg_ctx tag").

Should this be "full range LDIMM64 support" instead?

See: https://lore.kernel.org/bpf/CAEf4BzaLqWT1oj-EXibyAfE0ExmiaCCqhosRujDi7Y0Nyho6dA@mail.gmail.com/

> +	},
>  };



AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

In-Reply-To-Subject: libbpf: Add gating for arena globals relocation feature
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21878398162

AI-authorship-score: low
AI-authorship-explanation: The code follows standard libbpf feature probe patterns, includes iterative review responses documented in changelog, and shows natural debugging artifacts from review cycles.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Minor style issue - feature description capitalization should be lowercase to match other feature descriptions.

@kernel-patches-daemon-bpf
Copy link
Author

Add feature gating for the arena globals relocation introduced in
commit c1f6117. The commit depends on a previous commit in the
same patchset that is absent from older kernels (12a1fe6,
"bpf/verifier: Do not limit maximum direct offset into arena map").
Without this commit, arena globals relocation with arenas >= 512MiB
fails to load and breaks libbpf's backwards compatibility.

Introduce a libbpf feature to check whether the running kernel includes
patch 12a1fe6, and only relocate arena globals if it does.

CHANGELOG
---------

v3 -> v4 (https://lore.kernel.org/bpf/20260210005508.3642641-1-emil@etsalapatis.com/)

Incorporate feedback from Andrii:
	- Remove BTF and func_info
	- Use TRACEPOINT instead of SYSCALL to avoid using the SLEEPABLE flag
	- Improve string handling sizeof(log_buf) for libbpf buffer

v2 -> v3 (https://lore.kernel.org/bpf/20260209234850.2750149-1-emil@etsalapatis.com/)

- Rename feature to better specify the verifier feature it probes for
  (Andrii)

v1 -> v2 (https://lore.kernel.org/bpf/20260209210240.2051209-1-emil@etsalapatis.com/)

- Reworked test to use simpler array-based program (Andrii)

Fixes: c1f6117 ("libbpf: Move arena globals to the end of the arena")
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a9aabb3
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1052850
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1052850 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/1052850=>bpf-next branch February 10, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant