From: Leon Hwang <leon.hwang@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v6 06/12] libbpf: Add support for global percpu data
Date: Tue, 16 Jun 2026 12:17:38 +0800 [thread overview]
Message-ID: <2d04bd08-564f-4dcb-b00a-f021bc6bea31@linux.dev> (raw)
In-Reply-To: <20260615154158.5CF531F000E9@smtp.kernel.org>
On 15/6/26 23:41, sashiko-bot@kernel.org wrote:
[...]
>
>> @@ -1198,6 +1198,7 @@ void bpf_gen__map_update_elem(struct bpf_gen *gen, int map_idx, void *pvalue,
>> int zero = 0;
>>
>> memset(&attr, 0, attr_size);
>> + attr.flags = flags;
>
> [Severity: High]
> Does this assignment need to use tgt_endian() to support cross-compilation?
>
> When libbpf generates a skeleton loader for a target architecture with a
> different endianness than the host, fields populated into the union bpf_attr
> blob usually need to be converted to the target byte order.
>
> For global percpu data maps, this flag will be BPF_F_ALL_CPUS (0x10). If a
> little-endian host generates a skeleton for a big-endian target, a direct
> assignment of the 64-bit value could result in it being interpreted as
> 0x1000000000000000 by the target kernel, which would cause the sys_bpf
> call to fail with -EINVAL.
>
Will use tgt_endian() in the next revision.
Thanks,
Leon
next prev parent reply other threads:[~2026-06-16 4:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 15:26 [PATCH bpf-next v6 00/12] bpf: Introduce global percpu data Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 01/12] bpf: Drop duplicate blank lines in verifier Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 02/12] bpf: Disallow interpreter fallback for user BPF_ADDR_SPACE_CAST insn Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 03/12] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 04/12] bpf: Introduce global percpu data Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 05/12] libbpf: Probe percpu data feature Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 06/12] libbpf: Add support for global percpu data Leon Hwang
2026-06-15 15:41 ` sashiko-bot
2026-06-16 4:17 ` Leon Hwang [this message]
2026-06-15 15:26 ` [PATCH bpf-next v6 07/12] bpftool: Generate skeleton " Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 08/12] selftests/bpf: Add tests to verify " Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 09/12] selftests/bpf: Add test to verify accessing rdonly percpu_array Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 10/12] selftests/bpf: Add tests to verify verifier log for global percpu data Leon Hwang
2026-06-15 15:40 ` sashiko-bot
2026-06-16 4:18 ` Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 11/12] selftests/bpf: Add test to verify xlated insns " Leon Hwang
2026-06-15 21:29 ` Alexei Starovoitov
2026-06-16 4:18 ` Leon Hwang
2026-06-16 4:23 ` Alexei Starovoitov
2026-06-16 4:33 ` Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 12/12] selftests/bpf: Add test to 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=2d04bd08-564f-4dcb-b00a-f021bc6bea31@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox