]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/bpf: use movn/movk/movk sequence to generate kernel addresses
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 23 Nov 2018 17:29:02 +0000 (18:29 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 30 Nov 2018 09:23:25 +0000 (10:23 +0100)
commit05389f2f021d366f54bc4953c72d67db1258b1c0
treea795200021283d119ca0cb3a05ee1a6eb91926c4
parent1303ef5abbee8c814a7d9b1569e294479fb60716
arm64/bpf: use movn/movk/movk sequence to generate kernel addresses

On arm64, all executable code is guaranteed to reside in the vmalloc
space (or the module space), and so jump targets will only use 48
bits at most, and the remaining bits are guaranteed to be 0x1.

This means we can generate an immediate jump address using a sequence
of one MOVN (move wide negated) and two MOVK instructions, where the
first one sets the lower 16 bits but also sets all top bits to 0x1.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
arch/arm64/net/bpf_jit_comp.c