* [PATCH bpf-next 1/6] bpf: Defer instruction sync to the end of load time
2026-12-06 9:23 [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs Xu Kuohai
@ 2026-12-06 9:23 ` Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 2/6] bpf: Defer trampoline creation instruction sync Xu Kuohai
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ 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>
Instruction sync is currently performed at JIT time. For a program
with multiple subprogs, this means one sync per subprog JIT, while
only the last one is needed. Instruction sync is a heavy operation on
some architectures, like arm64, which broadcasts IPIs to all online
CPUs to flush the pipeline.
So defer instruction sync to the end of load time. Two weak functions
are introduced for architectures to override:
- bpf_arch_text_copy_nosync(): Copy JITed text without instruction sync.
- bpf_arch_text_synchronize(): Perform the deferred sync.
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
---
include/linux/bpf.h | 2 ++
kernel/bpf/core.c | 17 ++++++++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 4f8d419fd824..058630e00dda 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -4505,6 +4505,8 @@ void bpf_arch_poke_desc_update(struct bpf_jit_poke_descriptor *poke,
struct bpf_prog *new, struct bpf_prog *old);
void *bpf_arch_text_copy(void *dst, void *src, size_t len);
+void *bpf_arch_text_copy_nosync(void *dst, void *src, size_t len);
+void bpf_arch_text_synchronize(void);
int bpf_arch_text_invalidate(void *dst, size_t len);
struct btf_id_set;
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 4249abbf6ae4..e3b7879992c7 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -194,6 +194,10 @@ void bpf_prog_jit_attempt_done(struct bpf_prog *prog)
bpf_free_kfunc_tab(prog->aux->kfunc_tab);
prog->aux->kfunc_tab = NULL;
+
+ /* Synchronize instructions for all online CPUs */
+ if (prog->jited)
+ bpf_arch_text_synchronize();
}
/* The jit engine is responsible to provide an array
@@ -1559,7 +1563,8 @@ int bpf_jit_binary_pack_finalize(struct bpf_binary_header *ro_header,
{
void *ptr;
- ptr = bpf_arch_text_copy(ro_header, rw_header, rw_header->size);
+ /* Synchronization is deferred to bpf_prog_jit_attempt_done() */
+ ptr = bpf_arch_text_copy_nosync(ro_header, rw_header, rw_header->size);
kvfree(rw_header);
@@ -4072,6 +4077,16 @@ void * __weak bpf_arch_text_copy(void *dst, void *src, size_t len)
return ERR_PTR(-ENOTSUPP);
}
+void * __weak bpf_arch_text_copy_nosync(void *dst, void *src, size_t len)
+{
+ /* Fall back to sync copy if the arch does not override this hook */
+ return bpf_arch_text_copy(dst, src, len);
+}
+
+void __weak bpf_arch_text_synchronize(void)
+{
+}
+
int __weak bpf_arch_text_invalidate(void *dst, size_t len)
{
return -ENOTSUPP;
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH bpf-next 2/6] bpf: Defer trampoline creation instruction sync
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 ` Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 3/6] arm64: patching: Add nosync helpers for instruction copy and set Xu Kuohai
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ 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>
Like JIT, instruction sync is performed at trampoline creation time.
For struct_ops, which creates multiple trampolines at once, only the
final sync is needed. Defer the instruction sync to the time before
the trampoline is registered or linked, and document the requirement
on arch_prepare_bpf_trampoline().
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
---
include/linux/bpf.h | 4 ++++
kernel/bpf/bpf_struct_ops.c | 4 ++++
kernel/bpf/trampoline.c | 3 +++
net/bpf/bpf_dummy_struct_ops.c | 3 +++
4 files changed, 14 insertions(+)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 058630e00dda..7bceb2a34757 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1406,6 +1406,10 @@ struct bpf_tramp_run_ctx;
* fexit = a set of program to run after original function
*/
struct bpf_tramp_image;
+/*
+ * NOTE: The caller must call bpf_arch_text_synchronize() before executing or
+ * publishing the generated trampolines.
+ */
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,
const struct btf_func_model *m, u32 flags,
struct bpf_tramp_nodes *tnodes,
diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c
index 6ac596c156c2..fee3280b680a 100644
--- a/kernel/bpf/bpf_struct_ops.c
+++ b/kernel/bpf/bpf_struct_ops.c
@@ -1133,6 +1133,10 @@ static long __bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key,
goto reset_unlock;
}
+ /* Synchronize all member trampolines before handing them to the subsystem. */
+ if (st_map->image_pages_cnt)
+ bpf_arch_text_synchronize();
+
if (st_map->map.map_flags & BPF_F_LINK) {
err = 0;
/* Let bpf_link handle registration & unregistration.
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index 619297eae8c1..17656a548769 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -794,6 +794,9 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mut
if (err)
goto out_free;
+ /* Synchronize the trampoline image before publishing it. */
+ bpf_arch_text_synchronize();
+
if (tr->cur_image)
/* progs already running at this address */
err = ops->modify_fentry(tr, orig_flags, im, lock_direct_mutex, data);
diff --git a/net/bpf/bpf_dummy_struct_ops.c b/net/bpf/bpf_dummy_struct_ops.c
index c724a6bc7b80..001c42816aa8 100644
--- a/net/bpf/bpf_dummy_struct_ops.c
+++ b/net/bpf/bpf_dummy_struct_ops.c
@@ -186,6 +186,9 @@ int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr,
err = arch_protect_bpf_trampoline(image, PAGE_SIZE);
if (err)
goto out;
+
+ bpf_arch_text_synchronize();
+
prog_ret = dummy_ops_call_op(image, args);
err = dummy_ops_copy_args(args);
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH bpf-next 3/6] arm64: patching: Add nosync helpers for instruction copy and set
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 ` Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 4/6] bpf, arm64: Defer JIT instruction sync Xu Kuohai
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ 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>
Add nosync variants of the arm64 instruction copy and set functions.
They will be used by the following patches to remove unnecessary IPIs.
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
---
arch/arm64/include/asm/text-patching.h | 2 +
arch/arm64/kernel/patching.c | 63 +++++++++++++++++++++++---
2 files changed, 58 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/include/asm/text-patching.h b/arch/arm64/include/asm/text-patching.h
index 587bdb91ab7a..222566b020f2 100644
--- a/arch/arm64/include/asm/text-patching.h
+++ b/arch/arm64/include/asm/text-patching.h
@@ -9,7 +9,9 @@ int aarch64_insn_write(void *addr, u32 insn);
int aarch64_insn_write_literal_u64(void *addr, u64 val);
void *aarch64_insn_set(void *dst, u32 insn, size_t len);
+void *aarch64_insn_set_nosync(void *dst, u32 insn, size_t len);
void *aarch64_insn_copy(void *dst, void *src, size_t len);
+void *aarch64_insn_copy_nosync(void *dst, void *src, size_t len);
int aarch64_insn_patch_text_nosync(void *addr, u32 insn);
int aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt);
diff --git a/arch/arm64/kernel/patching.c b/arch/arm64/kernel/patching.c
index 09f019c6547a..5e28476db046 100644
--- a/arch/arm64/kernel/patching.c
+++ b/arch/arm64/kernel/patching.c
@@ -104,7 +104,8 @@ noinstr int aarch64_insn_write_literal_u64(void *addr, u64 val)
typedef void text_poke_f(void *dst, void *src, size_t patched, size_t len);
-static void *__text_poke(text_poke_f func, void *addr, void *src, size_t len)
+static void *__text_poke(text_poke_f func, void *addr, void *src, size_t len,
+ bool sync)
{
unsigned long flags;
size_t patched = 0;
@@ -126,7 +127,15 @@ static void *__text_poke(text_poke_f func, void *addr, void *src, size_t len)
}
raw_spin_unlock_irqrestore(&patch_lock, flags);
- flush_icache_range((uintptr_t)addr, (uintptr_t)addr + len);
+ caches_clean_inval_pou((uintptr_t)addr, (uintptr_t)addr + len);
+ /*
+ * IPI all online CPUs to force them to refetch the new instructions.
+ * KGDB uses IPIs to round-up the secondary CPUs during the patching
+ * operation, so we don't need extra IPIs here. See the comments in
+ * flush_icache_range() in arch/arm64/include/asm/cacheflush.h.
+ */
+ if (sync && !in_dbg_master())
+ kick_all_cpus_sync();
return addr;
}
@@ -143,6 +152,15 @@ static void text_poke_memset(void *dst, void *src, size_t patched, size_t len)
memset32(dst, c, len / 4);
}
+static void *__aarch64_insn_copy(void *dst, void *src, size_t len, bool sync)
+{
+ /* A64 instructions must be word aligned */
+ if ((uintptr_t)dst & 0x3)
+ return NULL;
+
+ return __text_poke(text_poke_memcpy, dst, src, len, sync);
+}
+
/**
* aarch64_insn_copy - Copy instructions into (an unused part of) RX memory
* @dst: address to modify
@@ -153,11 +171,30 @@ static void text_poke_memset(void *dst, void *src, size_t patched, size_t len)
*/
noinstr void *aarch64_insn_copy(void *dst, void *src, size_t len)
{
- /* A64 instructions must be word aligned */
+ return __aarch64_insn_copy(dst, src, len, true);
+}
+
+/**
+ * aarch64_insn_copy_nosync - Copy instructions into RX memory, no sync
+ * @dst: address to modify
+ * @src: source of the copy
+ * @len: length to copy
+ *
+ * Same as aarch64_insn_copy(), but does not IPI other CPUs to refetch
+ * the new instructions. The caller must do the synchronization before
+ * the text is executed.
+ */
+noinstr void *aarch64_insn_copy_nosync(void *dst, void *src, size_t len)
+{
+ return __aarch64_insn_copy(dst, src, len, false);
+}
+
+static void *__aarch64_insn_set(void *dst, u32 insn, size_t len, bool sync)
+{
if ((uintptr_t)dst & 0x3)
return NULL;
- return __text_poke(text_poke_memcpy, dst, src, len);
+ return __text_poke(text_poke_memset, dst, &insn, len, sync);
}
/**
@@ -170,10 +207,22 @@ noinstr void *aarch64_insn_copy(void *dst, void *src, size_t len)
*/
noinstr void *aarch64_insn_set(void *dst, u32 insn, size_t len)
{
- if ((uintptr_t)dst & 0x3)
- return NULL;
+ return __aarch64_insn_set(dst, insn, len, true);
+}
- return __text_poke(text_poke_memset, dst, &insn, len);
+/**
+ * aarch64_insn_set_nosync - memset for RX memory regions, no sync
+ * @dst: address to modify
+ * @insn: value to set
+ * @len: length of memory region.
+ *
+ * Same as aarch64_insn_set(), but does not IPI other CPUs to refetch
+ * the new instructions. The caller must do the synchronization before
+ * the text is executed.
+ */
+noinstr void *aarch64_insn_set_nosync(void *dst, u32 insn, size_t len)
+{
+ return __aarch64_insn_set(dst, insn, len, false);
}
int __kprobes aarch64_insn_patch_text_nosync(void *addr, u32 insn)
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH bpf-next 4/6] bpf, arm64: Defer JIT instruction sync
2026-12-06 9:23 [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs Xu Kuohai
` (2 preceding siblings ...)
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 9:23 ` Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 5/6] bpf, arm64: Defer trampoline creation " Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 6/6] bpf, arm64: Remove instruction sync when invalidating freed memory Xu Kuohai
5 siblings, 0 replies; 8+ 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>
Override bpf_arch_text_copy_nosync() and bpf_arch_text_synchronize()
on arm64 to enable deferred instruction sync for JIT. Also switch the
JIT error path to the nosync text copy.
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
---
arch/arm64/net/bpf_jit_comp.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 3ac287580d22..76d25947ace6 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -3231,8 +3231,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
prog->jited_len = 0;
}
if (header) {
- bpf_arch_text_copy(&ro_header->size, &header->size,
- sizeof(header->size));
+ bpf_arch_text_copy_nosync(&ro_header->size, &header->size,
+ sizeof(header->size));
bpf_jit_binary_pack_free(ro_header, header);
/* The private stack goes with the image, see out_off */
ro_header = NULL;
@@ -3288,6 +3288,18 @@ void *bpf_arch_text_copy(void *dst, void *src, size_t len)
return dst;
}
+void *bpf_arch_text_copy_nosync(void *dst, void *src, size_t len)
+{
+ if (!aarch64_insn_copy_nosync(dst, src, len))
+ return ERR_PTR(-EINVAL);
+ return dst;
+}
+
+void bpf_arch_text_synchronize(void)
+{
+ kick_all_cpus_sync();
+}
+
u64 bpf_jit_alloc_exec_limit(void)
{
return VMALLOC_END - VMALLOC_START;
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH bpf-next 5/6] bpf, arm64: Defer trampoline creation instruction sync
2026-12-06 9:23 [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs Xu Kuohai
` (3 preceding siblings ...)
2026-12-06 9:23 ` [PATCH bpf-next 4/6] bpf, arm64: Defer JIT instruction sync Xu Kuohai
@ 2026-12-06 9:23 ` Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 6/6] bpf, arm64: Remove instruction sync when invalidating freed memory Xu Kuohai
5 siblings, 0 replies; 8+ 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>
Use bpf_arch_text_copy_nosync() to copy trampoline images since the
generic code handles the instruction sync. Also return immediately on
trampoline generation failure, to avoid copying a discarded partial
image.
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
---
arch/arm64/net/bpf_jit_comp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 76d25947ace6..7b5519f1159c 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -4002,6 +4002,8 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *ro_image,
if (ret)
goto out;
ret = prepare_trampoline(&ctx, im, tnodes, func_addr, m, &aaux, flags);
+ if (ret < 0)
+ goto out;
if (ret > 0 && validate_code(&ctx) < 0) {
ret = -EINVAL;
@@ -4011,7 +4013,7 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *ro_image,
if (ret > 0)
ret *= AARCH64_INSN_SIZE;
- tmp = bpf_arch_text_copy(ro_image, image, size);
+ tmp = bpf_arch_text_copy_nosync(ro_image, image, size);
if (IS_ERR(tmp)) {
ret = PTR_ERR(tmp);
goto out;
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH bpf-next 6/6] bpf, arm64: Remove instruction sync when invalidating freed memory
2026-12-06 9:23 [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs Xu Kuohai
` (4 preceding siblings ...)
2026-12-06 9:23 ` [PATCH bpf-next 5/6] bpf, arm64: Defer trampoline creation " Xu Kuohai
@ 2026-12-06 9:23 ` Xu Kuohai
2026-12-06 10:19 ` bot+bpf-ci
5 siblings, 1 reply; 8+ 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>
The freed BPF image is no longer usable. When its memory is reused,
the new image is copied and an instruction sync is performed. So the
sync on the free path is not needed. Remove it.
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
---
arch/arm64/net/bpf_jit_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 7b5519f1159c..605deb44ccff 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -353,7 +353,7 @@ static void jit_fill_hole(void *area, unsigned int size)
int bpf_arch_text_invalidate(void *dst, size_t len)
{
- if (!aarch64_insn_set(dst, AARCH64_BREAK_FAULT, len))
+ if (!aarch64_insn_set_nosync(dst, AARCH64_BREAK_FAULT, len))
return -EINVAL;
return 0;
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH bpf-next 6/6] bpf, arm64: Remove instruction sync when invalidating freed memory
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
0 siblings, 0 replies; 8+ messages in thread
From: bot+bpf-ci @ 2026-12-06 10:19 UTC (permalink / raw)
To: xukuohai, bpf, linux-kernel
Cc: ast, daniel, andrii, eddyz87, memxor, song, yonghong.song, jolsa,
emil, john.fastabend, puranjay, catalin.marinas, will,
mark.rutland, ast, andrii, daniel, martin.lau, eddyz87,
yonghong.song, mason, ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
> bpf, arm64: Remove instruction sync when invalidating freed memory
TL;DR: Nit only: aarch64_insn_set() now has no callers after this change;
consider dropping it or making it skip the IPI instead of keeping both it and
aarch64_insn_set_nosync().
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index 7b5519f1159c..605deb44ccff 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -353,7 +353,7 @@ static void jit_fill_hole(void *area, unsigned int size)
>
> int bpf_arch_text_invalidate(void *dst, size_t len)
> {
> - if (!aarch64_insn_set(dst, AARCH64_BREAK_FAULT, len))
> + if (!aarch64_insn_set_nosync(dst, AARCH64_BREAK_FAULT, len))
> return -EINVAL;
>
> return 0;
This isn't a bug, but now that bpf_arch_text_invalidate() no longer calls
aarch64_insn_set(), nothing else in the tree does either. Should
aarch64_insn_set() be dropped, or changed in place to skip the IPI,
instead of keeping both it and aarch64_insn_set_nosync()?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/47636473460
^ permalink raw reply [flat|nested] 8+ messages in thread