Commit 2d8fe90a authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Ingo Molnar

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: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Acked-by: default avatarAlexei 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.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent f05058c4
...@@ -22,15 +22,16 @@ ...@@ -22,15 +22,16 @@
32 /* space for rbx,r13,r14,r15 */ + \ 32 /* space for rbx,r13,r14,r15 */ + \
8 /* space for skb_copy_bits */) 8 /* space for skb_copy_bits */)
sk_load_word: #define FUNC(name) \
.globl sk_load_word .globl name; \
.type name, @function; \
name:
FUNC(sk_load_word)
test %esi,%esi test %esi,%esi
js bpf_slow_path_word_neg js bpf_slow_path_word_neg
sk_load_word_positive_offset: FUNC(sk_load_word_positive_offset)
.globl sk_load_word_positive_offset
mov %r9d,%eax # hlen mov %r9d,%eax # hlen
sub %esi,%eax # hlen - offset sub %esi,%eax # hlen - offset
cmp $3,%eax cmp $3,%eax
...@@ -39,15 +40,11 @@ sk_load_word_positive_offset: ...@@ -39,15 +40,11 @@ sk_load_word_positive_offset:
bswap %eax /* ntohl() */ bswap %eax /* ntohl() */
ret ret
sk_load_half: FUNC(sk_load_half)
.globl sk_load_half
test %esi,%esi test %esi,%esi
js bpf_slow_path_half_neg js bpf_slow_path_half_neg
sk_load_half_positive_offset: FUNC(sk_load_half_positive_offset)
.globl sk_load_half_positive_offset
mov %r9d,%eax mov %r9d,%eax
sub %esi,%eax # hlen - offset sub %esi,%eax # hlen - offset
cmp $1,%eax cmp $1,%eax
...@@ -56,15 +53,11 @@ sk_load_half_positive_offset: ...@@ -56,15 +53,11 @@ sk_load_half_positive_offset:
rol $8,%ax # ntohs() rol $8,%ax # ntohs()
ret ret
sk_load_byte: FUNC(sk_load_byte)
.globl sk_load_byte
test %esi,%esi test %esi,%esi
js bpf_slow_path_byte_neg js bpf_slow_path_byte_neg
sk_load_byte_positive_offset: FUNC(sk_load_byte_positive_offset)
.globl sk_load_byte_positive_offset
cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */ cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */
jle bpf_slow_path_byte jle bpf_slow_path_byte
movzbl (SKBDATA,%rsi),%eax movzbl (SKBDATA,%rsi),%eax
...@@ -120,8 +113,8 @@ bpf_slow_path_byte: ...@@ -120,8 +113,8 @@ bpf_slow_path_byte:
bpf_slow_path_word_neg: bpf_slow_path_word_neg:
cmp SKF_MAX_NEG_OFF, %esi /* test range */ cmp SKF_MAX_NEG_OFF, %esi /* test range */
jl bpf_error /* offset lower -> error */ jl bpf_error /* offset lower -> error */
sk_load_word_negative_offset:
.globl sk_load_word_negative_offset FUNC(sk_load_word_negative_offset)
sk_negative_common(4) sk_negative_common(4)
mov (%rax), %eax mov (%rax), %eax
bswap %eax bswap %eax
...@@ -130,8 +123,8 @@ sk_load_word_negative_offset: ...@@ -130,8 +123,8 @@ sk_load_word_negative_offset:
bpf_slow_path_half_neg: bpf_slow_path_half_neg:
cmp SKF_MAX_NEG_OFF, %esi cmp SKF_MAX_NEG_OFF, %esi
jl bpf_error jl bpf_error
sk_load_half_negative_offset:
.globl sk_load_half_negative_offset FUNC(sk_load_half_negative_offset)
sk_negative_common(2) sk_negative_common(2)
mov (%rax),%ax mov (%rax),%ax
rol $8,%ax rol $8,%ax
...@@ -141,8 +134,8 @@ sk_load_half_negative_offset: ...@@ -141,8 +134,8 @@ sk_load_half_negative_offset:
bpf_slow_path_byte_neg: bpf_slow_path_byte_neg:
cmp SKF_MAX_NEG_OFF, %esi cmp SKF_MAX_NEG_OFF, %esi
jl bpf_error jl bpf_error
sk_load_byte_negative_offset:
.globl sk_load_byte_negative_offset FUNC(sk_load_byte_negative_offset)
sk_negative_common(1) sk_negative_common(1)
movzbl (%rax), %eax movzbl (%rax), %eax
ret ret
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment