Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selftests/bpf: Fix arena_spin_lock compilation on PowerPC #8652

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: selftests/bpf: Fix arena_spin_lock compilation on PowerPC
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=942760

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

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

Venkat reported a compilation error for BPF selftests on PowerPC [0].
The crux of the error is the following message:
  In file included from progs/arena_spin_lock.c:7:
  /root/bpf-next/tools/testing/selftests/bpf/bpf_arena_spin_lock.h:122:8:
  error: member reference base type '__attribute__((address_space(1)))
  u32' (aka '__attribute__((address_space(1))) unsigned int') is not a
  structure or union
     122 |         old = atomic_read(&lock->val);

This is because PowerPC overrides the qspinlock type changing the
lock->val member's type from atomic_t to u32.

To remedy this, import the asm-generic version in the arena spin lock
header, name it __qspinlock (since it's aliased to arena_spinlock_t, the
actual name hardly matters), and adjust the selftest to not depend on
the type in vmlinux.h.

  [0]: https://lore.kernel.org/bpf/[email protected]

Fixes: 0201027 ("selftests/bpf: Introduce arena spin lock")
Reported-by: Venkat Rao Bagalkote <[email protected]>
Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
Tested-by: Venkat Rao Bagalkote <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/942760=>bpf-next branch March 12, 2025 23:38
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