BPF List
 help / color / mirror / Atom feed
From: Puranjay Mohan <puranjay@kernel.org>
To: Anton Protopopov <a.s.protopopov@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>,
	Xu Kuohai <xukuohai@huaweicloud.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	kernel-team@meta.com, Yonghong Song <yonghong.song@linux.dev>
Subject: Re: [PATCH bpf-next 0/4] bpf: arm64: Indirect jumps
Date: Mon, 17 Nov 2025 13:01:05 +0000	[thread overview]
Message-ID: <mb61p4iqsn78u.fsf@kernel.org> (raw)
In-Reply-To: <aRrX7eXoWL1RhtJO@mail.gmail.com>

Anton Protopopov <a.s.protopopov@gmail.com> writes:

> On 25/11/17 12:46AM, Puranjay Mohan wrote:
>> This set adds the support of indirect jumps to the arm64 JIT. It
>> involves calling bpf_prog_update_insn_ptrs() to support instructions
>> array map. The second piece is supporting BPF_JMP|BPF_X|BPF_JA, SRC=0,
>> DST=Rx, off=0, imm=0 instruction that is trivial to implement on arm64.
>>
>> When running the selftests after doing the above changes, I found that
>> on arm64 builds of llvm, a relocation section was being generated for
>> .jumptables sections and it was making libbpf fail like:
>> 
>> libbpf: relocation against STT_SECTION in non-exec section is not supported!
>> Error: failed to link 'tools/testing/selftests/bpf/cpuv4/bpf_gotox.bpf.o': Invalid argument (22)
>> 
>> Which is due to:
>> 
>> Relocation section '.rel.jumptables' at offset 0x5b50 contains 263 entries:
>>     Offset             Info             Type               Symbol's Value  Symbol's Name
>> 0000000000000000  0000000300000002 R_BPF_64_ABS64         0000000000000000 syscall
>> 0000000000000008  0000000300000002 R_BPF_64_ABS64         0000000000000000 syscall
>> 0000000000000010  0000000300000002 R_BPF_64_ABS64         0000000000000000 syscall
>> 
>> This rel section is not generated by x86 builds of LLVM. The third patch
>> of this set makes libbpf ignore relocation sections for .jumptables.
>
> I added Yonghong to this thread. He had fixed this problem in
> https://github.com/llvm/llvm-project/pull/166301 changes doesn't seem to be
> x86-specific...

My arm64 build didn't have this change, that is why it was failing.
After pulling the latest changes and building again, it works without
the libbpf patch.

So, I will send v2 and drop the libbpf patch.

Thanks,
Puranjay

      reply	other threads:[~2025-11-17 13:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17  0:46 [PATCH bpf-next 0/4] bpf: arm64: Indirect jumps Puranjay Mohan
2025-11-17  0:46 ` [PATCH bpf-next 1/4] bpf: arm64: Add support for instructions array Puranjay Mohan
2025-11-17  8:22   ` Anton Protopopov
2025-11-17  0:46 ` [PATCH bpf-next 2/4] bpf: arm64: Add support for indirect jumps Puranjay Mohan
2025-11-17  8:23   ` Anton Protopopov
2025-11-17  0:46 ` [PATCH bpf-next 3/4] libbpf: Ignore relocations for .jumptables sections Puranjay Mohan
2025-11-17  0:46 ` [PATCH bpf-next 4/4] selftests: bpf: Enable gotox tests from arm64 Puranjay Mohan
2025-11-17  8:24   ` Anton Protopopov
2025-11-17  8:08 ` [PATCH bpf-next 0/4] bpf: arm64: Indirect jumps Anton Protopopov
2025-11-17 13:01   ` Puranjay Mohan [this message]

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=mb61p4iqsn78u.fsf@kernel.org \
    --to=puranjay@kernel.org \
    --cc=a.s.protopopov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=will@kernel.org \
    --cc=xukuohai@huaweicloud.com \
    --cc=yonghong.song@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