bpf, x86: Align dispatcher branch targets to 16B
authorBjörn Töpel <bjorn.topel@intel.com>
Fri, 13 Dec 2019 17:51:12 +0000 (18:51 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Dec 2019 21:09:32 +0000 (13:09 -0800)
commit116eb788f57c9c35c40b29cfaa2607020de99a84
tree607fdc7c30ce8dd968619afb8b90e2a980ae14ab
parente754f5a6e36b63d6732f52adcbe4c447fd66896f
bpf, x86: Align dispatcher branch targets to 16B

>From Intel 64 and IA-32 Architectures Optimization Reference Manual,
3.4.1.4 Code Alignment, Assembly/Compiler Coding Rule 11: All branch
targets should be 16-byte aligned.

This commits aligns branch targets according to the Intel manual.

The nops used to align branch targets make the dispatcher larger, and
therefore the number of supported dispatch points/programs are
descreased from 64 to 48.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191213175112.30208-7-bjorn.topel@gmail.com
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h