[PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs

From: Xu Kuohai

Date: Sun Dec 06 2026 - 04:51:41 EST


From: Xu Kuohai <xukuohai@xxxxxxxxxx>

On arm64, instruction sync broadcasts IPIs to all online CPUs. A BPF
program with multiple subprograms can trigger this synchronization
once for every subprogram during loading.

So defer instruction sync until all JIT images have been created and
the program is ready to execute. Apply the same approach to trampoline
creation so struct_ops can sync multiple trampolines with one IPI
broadcast.

Also remove the synchronization performed when invalidating freed BPF
image, since the memory is no longer executable and new code is
synchronized before it can run.

Xu Kuohai (6):
bpf: Defer instruction sync to the end of load time
bpf: Defer trampoline creation instruction sync
arm64: patching: Add nosync helpers for instruction copy and set
bpf, arm64: Defer JIT instruction sync
bpf, arm64: Defer trampoline creation instruction sync
bpf, arm64: Remove instruction sync when invalidating freed memory

arch/arm64/include/asm/text-patching.h | 2 +
arch/arm64/kernel/patching.c | 63 +++++++++++++++++++++++---
arch/arm64/net/bpf_jit_comp.c | 22 +++++++--
include/linux/bpf.h | 6 +++
kernel/bpf/bpf_struct_ops.c | 4 ++
kernel/bpf/core.c | 17 ++++++-
kernel/bpf/trampoline.c | 3 ++
net/bpf/bpf_dummy_struct_ops.c | 3 ++
8 files changed, 108 insertions(+), 12 deletions(-)

--
2.47.3