BPF List
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	kkd@meta.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next v1] selftests/bpf: Fix arena_spin_lock compilation on PowerPC
Date: Tue, 11 Mar 2025 23:51:43 +0530	[thread overview]
Message-ID: <714157d1-dd6a-4ed9-8177-b8cf1bdee0f6@linux.ibm.com> (raw)
In-Reply-To: <CAP01T7622-6+e4K_O+AH978Jbp=M8HBe5ho2H4yS4FoTJ8=COQ@mail.gmail.com>

On 11/03/25 9:13 pm, Kumar Kartikeya Dwivedi wrote:
> On Tue, 11 Mar 2025 at 16:42, Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote:
>> 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/7bc80a3b-d708-4735-aa3b-6a8c21720f9d@linux.ibm.com
>>
>> Fixes: 0201027a026c ("selftests/bpf: Introduce arena spin lock")
>> Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
>> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
>> ---

Built the kernel by applying this patch on bpf-next. And selftests/bpf 
compiles successfully.

Please add below tag.


Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>

> Venkat, please help test, as CI and I don't have access to a PowerPC machine.
>
> Thanks!

  reply	other threads:[~2025-03-11 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 15:42 [PATCH bpf-next v1] selftests/bpf: Fix arena_spin_lock compilation on PowerPC Kumar Kartikeya Dwivedi
2025-03-11 15:43 ` Kumar Kartikeya Dwivedi
2025-03-11 18:21   ` Venkat Rao Bagalkote [this message]
2025-03-12 23:30 ` patchwork-bot+netdevbpf

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=714157d1-dd6a-4ed9-8177-b8cf1bdee0f6@linux.ibm.com \
    --to=venkat88@linux.ibm.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox