diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-02-26 16:13:52 -0500 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-02-27 12:18:58 -0500 |
commit | 71d22d58b6e507147a9008ce2fd690cf311c97f9 (patch) | |
tree | 674639a0147c7234c88e3e23d06dc6ff26a6d7b2 | |
parent | 6f1b5a2b58d8470e5a8b25ab29f5fdb4616ffff8 (diff) |
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>
-rw-r--r-- | arch/x86/net/bpf_jit_comp.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index cbf94d44f3d5..eb661fff94d7 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -11,10 +11,10 @@ | |||
11 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
12 | #include <linux/filter.h> | 12 | #include <linux/filter.h> |
13 | #include <linux/if_vlan.h> | 13 | #include <linux/if_vlan.h> |
14 | #include <asm/cacheflush.h> | 14 | #include <linux/bpf.h> |
15 | |||
15 | #include <asm/set_memory.h> | 16 | #include <asm/set_memory.h> |
16 | #include <asm/nospec-branch.h> | 17 | #include <asm/nospec-branch.h> |
17 | #include <linux/bpf.h> | ||
18 | 18 | ||
19 | /* | 19 | /* |
20 | * assembly code in arch/x86/net/bpf_jit.S | 20 | * assembly code in arch/x86/net/bpf_jit.S |
@@ -103,16 +103,6 @@ static int bpf_size_to_x86_bytes(int bpf_size) | |||
103 | #define X86_JLE 0x7E | 103 | #define X86_JLE 0x7E |
104 | #define X86_JG 0x7F | 104 | #define X86_JG 0x7F |
105 | 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 | |||
116 | #define CHOOSE_LOAD_FUNC(K, func) \ | 106 | #define CHOOSE_LOAD_FUNC(K, func) \ |
117 | ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset) | 107 | ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset) |
118 | 108 | ||
@@ -1266,7 +1256,6 @@ skip_init_addrs: | |||
1266 | bpf_jit_dump(prog->len, proglen, pass + 1, image); | 1256 | bpf_jit_dump(prog->len, proglen, pass + 1, image); |
1267 | 1257 | ||
1268 | if (image) { | 1258 | if (image) { |
1269 | bpf_flush_icache(header, image + proglen); | ||
1270 | if (!prog->is_func || extra_pass) { | 1259 | if (!prog->is_func || extra_pass) { |
1271 | bpf_jit_binary_lock_ro(header); | 1260 | bpf_jit_binary_lock_ro(header); |
1272 | } else { | 1261 | } else { |