ARM: net: bpf: avoid 'bx' instruction on non-Thumb capable CPUs
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 13 Jan 2018 11:35:15 +0000 (11:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:43 +0000 (14:03 +0100)
commit124047a81eae1fad08482aa122e683f602fe85dc
tree7a950d6f9ec37d0bfb5475ead72da6d4a761324b
parent326efb49e153fbb9ccacaed9858bd9da91204061
ARM: net: bpf: avoid 'bx' instruction on non-Thumb capable CPUs

commit e9062481824384f00299971f923fecf6b3668001 upstream.

Avoid the 'bx' instruction on CPUs that have no support for Thumb and
thus do not implement this instruction by moving the generation of this
opcode to a separate function that selects between:

bx reg

and

mov pc, reg

according to the capabilities of the CPU.

Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/net/bpf_jit_32.c