Skip to content

selftests/bpf: Use both hrtimer enqueue helpers in vmlinux test#12030

Closed
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf_basefrom
series/1091008=>bpf
Closed

selftests/bpf: Use both hrtimer enqueue helpers in vmlinux test#12030
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf_basefrom
series/1091008=>bpf

Conversation

@kernel-patches-daemon-bpf
Copy link
Copy Markdown

Pull request for series with
subject: selftests/bpf: Use both hrtimer enqueue helpers in vmlinux test
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1091008

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 0c7ae13
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1091008
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: f3b8c28
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1091008
version: 1

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 18fc650
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1091008
version: 1

The vmlinux selftest triggers nanosleep and checks that both kprobe
and fentry programs observe the hrtimer enqueue path.

After the hrtimer_start_expires_user() conversion [1], nanosleep
reaches hrtimer_start_range_ns_user() instead of
hrtimer_start_range_ns(). Hard-coding either symbol makes the test
fail either on bpf tree or on linux-next [2].

Keep both hook variants as optional BPF programs and enable the pair
matching the running kernel before loading the object. This is also a
nice example of how to modify a BPF program to work on both older and
newer kernel revision.

[1] https://lore.kernel.org/all/20260408114952.062400833@kernel.org/
[2] https://github.com/kernel-patches/bpf/actions/runs/25485909958/job/74782902203

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
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