Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf, x64: remove bpf_flush_icache

Unlike other archs flush_icache_range() is a noop on x64, therefore
remove the JIT's bpf_flush_icache() altogether since not needed.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Daniel Borkmann and committed by
Alexei Starovoitov
71d22d58 6f1b5a2b

+2 -13
+2 -13
arch/x86/net/bpf_jit_comp.c
··· 11 11 #include <linux/netdevice.h> 12 12 #include <linux/filter.h> 13 13 #include <linux/if_vlan.h> 14 - #include <asm/cacheflush.h> 14 + #include <linux/bpf.h> 15 + 15 16 #include <asm/set_memory.h> 16 17 #include <asm/nospec-branch.h> 17 - #include <linux/bpf.h> 18 18 19 19 /* 20 20 * assembly code in arch/x86/net/bpf_jit.S ··· 102 102 #define X86_JGE 0x7D 103 103 #define X86_JLE 0x7E 104 104 #define X86_JG 0x7F 105 - 106 - static void bpf_flush_icache(void *start, void *end) 107 - { 108 - mm_segment_t old_fs = get_fs(); 109 - 110 - set_fs(KERNEL_DS); 111 - smp_wmb(); 112 - flush_icache_range((unsigned long)start, (unsigned long)end); 113 - set_fs(old_fs); 114 - } 115 105 116 106 #define CHOOSE_LOAD_FUNC(K, func) \ 117 107 ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset) ··· 1256 1266 bpf_jit_dump(prog->len, proglen, pass + 1, image); 1257 1267 1258 1268 if (image) { 1259 - bpf_flush_icache(header, image + proglen); 1260 1269 if (!prog->is_func || extra_pass) { 1261 1270 bpf_jit_binary_lock_ro(header); 1262 1271 } else {