summaryrefslogtreecommitdiffstats
path: root/arch/x86/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorYonghong Song <yonghong.song@linux.dev>2023-07-28 03:12:13 +0200
committerAlexei Starovoitov <ast@kernel.org>2023-07-28 03:52:33 +0200
commit0845c3db7bf5c4ceb7100bcd8fd594d9ccf3c29a (patch)
treef60e9cb2004b103c0ab01257bdb9952d06df292d /arch/x86/net/bpf_jit_comp.c
parentbpf: Handle sign-extenstin ctx member accesses (diff)
downloadlinux-0845c3db7bf5c4ceb7100bcd8fd594d9ccf3c29a.tar.xz
linux-0845c3db7bf5c4ceb7100bcd8fd594d9ccf3c29a.zip
bpf: Support new unconditional bswap instruction
The existing 'be' and 'le' insns will do conditional bswap depends on host endianness. This patch implements unconditional bswap insns. Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/r/20230728011213.3712808-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'arch/x86/net/bpf_jit_comp.c')
-rw-r--r--arch/x86/net/bpf_jit_comp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 031ef3c4185d..4942a4c188b9 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1322,6 +1322,7 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image
break;
case BPF_ALU | BPF_END | BPF_FROM_BE:
+ case BPF_ALU64 | BPF_END | BPF_FROM_LE:
switch (imm32) {
case 16:
/* Emit 'ror %ax, 8' to swap lower 2 bytes */