bpf, x64: Factor out emission of REX byte in more cases
authorJie Meng <jmeng@fb.com>
Wed, 6 Oct 2021 19:41:35 +0000 (12:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:50 +0000 (09:32 +0100)
commiteea5a58d86a4cc19660bc8e03be926c928cf4db0
treea7b191de4f51e07e58889ab0cd788d2210dc8856
parent7e83a6577d5c7a5d6049fa062e51dd5d4170a2f4
bpf, x64: Factor out emission of REX byte in more cases

commit 6364d7d75a0e015a405d1f8a07f267f076c36ca6 upstream.

Introduce a single reg version of maybe_emit_mod() and factor out
common code in more cases.

Signed-off-by: Jie Meng <jmeng@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211006194135.608932-1-jmeng@fb.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/net/bpf_jit_comp.c