aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/net
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-01-21 17:49:26 -0500
committerIngo Molnar <mingo@kernel.org>2016-02-24 02:35:43 -0500
commit2d8fe90a1b96d52c2a3f719c385b846b02f0bcd8 (patch)
treed4c010e2c422618c6f196122ee635fcf6807a367 /arch/x86/net
parentf05058c4d652b619adfda6c78d8f5b341169c264 (diff)
x86/asm/bpf: Annotate callable functions
bpf_jit.S has several functions which can be called from C code. Give them proper ELF annotations. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Chris J Arges <chris.j.arges@canonical.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lkml.kernel.org/r/bbe1de0c299fecd4fc9a1766bae8be2647bedb01.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/net')
-rw-r--r--arch/x86/net/bpf_jit.S39
1 files changed, 16 insertions, 23 deletions
diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S
index 4093216b3791..eb4a3bd293eb 100644
--- a/arch/x86/net/bpf_jit.S
+++ b/arch/x86/net/bpf_jit.S
@@ -22,15 +22,16 @@
22 32 /* space for rbx,r13,r14,r15 */ + \ 22 32 /* space for rbx,r13,r14,r15 */ + \
23 8 /* space for skb_copy_bits */) 23 8 /* space for skb_copy_bits */)
24 24
25sk_load_word: 25#define FUNC(name) \
26 .globl sk_load_word 26 .globl name; \
27 .type name, @function; \
28 name:
27 29
30FUNC(sk_load_word)
28 test %esi,%esi 31 test %esi,%esi
29 js bpf_slow_path_word_neg 32 js bpf_slow_path_word_neg
30 33
31sk_load_word_positive_offset: 34FUNC(sk_load_word_positive_offset)
32 .globl sk_load_word_positive_offset
33
34 mov %r9d,%eax # hlen 35 mov %r9d,%eax # hlen
35 sub %esi,%eax # hlen - offset 36 sub %esi,%eax # hlen - offset
36 cmp $3,%eax 37 cmp $3,%eax
@@ -39,15 +40,11 @@ sk_load_word_positive_offset:
39 bswap %eax /* ntohl() */ 40 bswap %eax /* ntohl() */
40 ret 41 ret
41 42
42sk_load_half: 43FUNC(sk_load_half)
43 .globl sk_load_half
44
45 test %esi,%esi 44 test %esi,%esi
46 js bpf_slow_path_half_neg 45 js bpf_slow_path_half_neg
47 46
48sk_load_half_positive_offset: 47FUNC(sk_load_half_positive_offset)
49 .globl sk_load_half_positive_offset
50
51 mov %r9d,%eax 48 mov %r9d,%eax
52 sub %esi,%eax # hlen - offset 49 sub %esi,%eax # hlen - offset
53 cmp $1,%eax 50 cmp $1,%eax
@@ -56,15 +53,11 @@ sk_load_half_positive_offset:
56 rol $8,%ax # ntohs() 53 rol $8,%ax # ntohs()
57 ret 54 ret
58 55
59sk_load_byte: 56FUNC(sk_load_byte)
60 .globl sk_load_byte
61
62 test %esi,%esi 57 test %esi,%esi
63 js bpf_slow_path_byte_neg 58 js bpf_slow_path_byte_neg
64 59
65sk_load_byte_positive_offset: 60FUNC(sk_load_byte_positive_offset)
66 .globl sk_load_byte_positive_offset
67
68 cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */ 61 cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */
69 jle bpf_slow_path_byte 62 jle bpf_slow_path_byte
70 movzbl (SKBDATA,%rsi),%eax 63 movzbl (SKBDATA,%rsi),%eax
@@ -120,8 +113,8 @@ bpf_slow_path_byte:
120bpf_slow_path_word_neg: 113bpf_slow_path_word_neg:
121 cmp SKF_MAX_NEG_OFF, %esi /* test range */ 114 cmp SKF_MAX_NEG_OFF, %esi /* test range */
122 jl bpf_error /* offset lower -> error */ 115 jl bpf_error /* offset lower -> error */
123sk_load_word_negative_offset: 116
124 .globl sk_load_word_negative_offset 117FUNC(sk_load_word_negative_offset)
125 sk_negative_common(4) 118 sk_negative_common(4)
126 mov (%rax), %eax 119 mov (%rax), %eax
127 bswap %eax 120 bswap %eax
@@ -130,8 +123,8 @@ sk_load_word_negative_offset:
130bpf_slow_path_half_neg: 123bpf_slow_path_half_neg:
131 cmp SKF_MAX_NEG_OFF, %esi 124 cmp SKF_MAX_NEG_OFF, %esi
132 jl bpf_error 125 jl bpf_error
133sk_load_half_negative_offset: 126
134 .globl sk_load_half_negative_offset 127FUNC(sk_load_half_negative_offset)
135 sk_negative_common(2) 128 sk_negative_common(2)
136 mov (%rax),%ax 129 mov (%rax),%ax
137 rol $8,%ax 130 rol $8,%ax
@@ -141,8 +134,8 @@ sk_load_half_negative_offset:
141bpf_slow_path_byte_neg: 134bpf_slow_path_byte_neg:
142 cmp SKF_MAX_NEG_OFF, %esi 135 cmp SKF_MAX_NEG_OFF, %esi
143 jl bpf_error 136 jl bpf_error
144sk_load_byte_negative_offset: 137
145 .globl sk_load_byte_negative_offset 138FUNC(sk_load_byte_negative_offset)
146 sk_negative_common(1) 139 sk_negative_common(1)
147 movzbl (%rax), %eax 140 movzbl (%rax), %eax
148 ret 141 ret