BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs
@ 2026-12-06  9:23 Xu Kuohai
  2026-12-06  9:23 ` [PATCH bpf-next 1/6] bpf: Defer instruction sync to the end of load time Xu Kuohai
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Xu Kuohai @ 2026-12-06  9:23 UTC (permalink / raw)
  To: bpf, linux-kernel
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, Song Liu,
	Yonghong Song, Jiri Olsa, Emil Tsalapatis, John Fastabend,
	Puranjay Mohan, Catalin Marinas, Will Deacon, Mark Rutland

From: Xu Kuohai <xukuohai@huawei.com>

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-12-06 10:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06  9:23 [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs Xu Kuohai
2026-12-06  9:23 ` [PATCH bpf-next 1/6] bpf: Defer instruction sync to the end of load time Xu Kuohai
2026-12-06  9:23 ` [PATCH bpf-next 2/6] bpf: Defer trampoline creation instruction sync Xu Kuohai
2026-12-06  9:23 ` [PATCH bpf-next 3/6] arm64: patching: Add nosync helpers for instruction copy and set Xu Kuohai
2026-12-06 10:12   ` sashiko-bot
2026-12-06  9:23 ` [PATCH bpf-next 4/6] bpf, arm64: Defer JIT instruction sync Xu Kuohai
2026-12-06 10:14   ` sashiko-bot
2026-12-06  9:23 ` [PATCH bpf-next 5/6] bpf, arm64: Defer trampoline creation " Xu Kuohai
2026-12-06 10:12   ` sashiko-bot
2026-12-06  9:23 ` [PATCH bpf-next 6/6] bpf, arm64: Remove instruction sync when invalidating freed memory Xu Kuohai
2026-12-06 10:19   ` bot+bpf-ci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox