projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb0a1d6
)
bpf, arm64: Support unconditional bswap
author
Xu Kuohai
<xukuohai@huawei.com>
Tue, 15 Aug 2023 15:41:55 +0000
(11:41 -0400)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Fri, 18 Aug 2023 13:46:09 +0000
(15:46 +0200)
Add JIT support for unconditional bswap instructions.
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Florent Revest <revest@chromium.org>
Acked-by: Florent Revest <revest@chromium.org>
Link:
https://lore.kernel.org/bpf/20230815154158.717901-5-xukuohai@huaweicloud.com
arch/arm64/net/bpf_jit_comp.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/arm64/net/bpf_jit_comp.c
b/arch/arm64/net/bpf_jit_comp.c
index 9b796e74ef42d525ebe0d3c69119d77c6f8a836b..1d35acb880dc6c7a8d757f20775d8b738fbf59a6 100644
(file)
--- a/
arch/arm64/net/bpf_jit_comp.c
+++ b/
arch/arm64/net/bpf_jit_comp.c
@@
-855,11
+855,12
@@
static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
/* dst = BSWAP##imm(dst) */
case BPF_ALU | BPF_END | BPF_FROM_LE:
case BPF_ALU | BPF_END | BPF_FROM_BE:
+ case BPF_ALU64 | BPF_END | BPF_FROM_LE:
#ifdef CONFIG_CPU_BIG_ENDIAN
- if (BPF_SRC(code) == BPF_FROM_BE)
+ if (BPF_
CLASS(code) == BPF_ALU && BPF_
SRC(code) == BPF_FROM_BE)
goto emit_bswap_uxt;
#else /* !CONFIG_CPU_BIG_ENDIAN */
- if (BPF_SRC(code) == BPF_FROM_LE)
+ if (BPF_
CLASS(code) == BPF_ALU && BPF_
SRC(code) == BPF_FROM_LE)
goto emit_bswap_uxt;
#endif
switch (imm) {