Skip to content

Commit 90f426d

Browse files
iii-iAlexei Starovoitov
authored andcommitted
s390/bpf: Implement unconditional byte swap
Implement the cpuv4 unconditional byte swap, which is encoded as BPF_ALU64 | BPF_END | BPF_FROM_LE. Since s390x is big-endian, it's the same as the existing BPF_ALU | BPF_END | BPF_FROM_LE. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Link: https://lore.kernel.org/r/20230919101336.2223655-7-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 738476a commit 90f426d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/s390/net/bpf_jit_comp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
12531253
}
12541254
break;
12551255
case BPF_ALU | BPF_END | BPF_FROM_LE:
1256+
case BPF_ALU64 | BPF_END | BPF_FROM_LE:
12561257
switch (imm) {
12571258
case 16: /* dst = (u16) cpu_to_le16(dst) */
12581259
/* lrvr %dst,%dst */

0 commit comments

Comments
 (0)