forked from raspberrypi/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'stable/linux-4.1.y' into rpi-4.1.y
- Loading branch information
Showing
136 changed files
with
1,199 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
VERSION = 4 | ||
PATCHLEVEL = 1 | ||
SUBLEVEL = 16 | ||
SUBLEVEL = 17 | ||
EXTRAVERSION = | ||
NAME = Series 4800 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* BPF JIT compiler for ARM64 | ||
* | ||
* Copyright (C) 2014 Zi Shen Lim <[email protected]> | ||
* Copyright (C) 2014-2015 Zi Shen Lim <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
|
@@ -35,6 +35,7 @@ | |
aarch64_insn_gen_comp_branch_imm(0, offset, Rt, A64_VARIANT(sf), \ | ||
AARCH64_INSN_BRANCH_COMP_##type) | ||
#define A64_CBZ(sf, Rt, imm19) A64_COMP_BRANCH(sf, Rt, (imm19) << 2, ZERO) | ||
#define A64_CBNZ(sf, Rt, imm19) A64_COMP_BRANCH(sf, Rt, (imm19) << 2, NONZERO) | ||
|
||
/* Conditional branch (immediate) */ | ||
#define A64_COND_BRANCH(cond, offset) \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* BPF JIT compiler for ARM64 | ||
* | ||
* Copyright (C) 2014 Zi Shen Lim <[email protected]> | ||
* Copyright (C) 2014-2015 Zi Shen Lim <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
|
@@ -225,6 +225,17 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | |
u8 jmp_cond; | ||
s32 jmp_offset; | ||
|
||
#define check_imm(bits, imm) do { \ | ||
if ((((imm) > 0) && ((imm) >> (bits))) || \ | ||
(((imm) < 0) && (~(imm) >> (bits)))) { \ | ||
pr_info("[%2d] imm=%d(0x%x) out of range\n", \ | ||
i, imm, imm); \ | ||
return -EINVAL; \ | ||
} \ | ||
} while (0) | ||
#define check_imm19(imm) check_imm(19, imm) | ||
#define check_imm26(imm) check_imm(26, imm) | ||
|
||
switch (code) { | ||
/* dst = src */ | ||
case BPF_ALU | BPF_MOV | BPF_X: | ||
|
@@ -258,15 +269,33 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | |
break; | ||
case BPF_ALU | BPF_DIV | BPF_X: | ||
case BPF_ALU64 | BPF_DIV | BPF_X: | ||
emit(A64_UDIV(is64, dst, dst, src), ctx); | ||
break; | ||
case BPF_ALU | BPF_MOD | BPF_X: | ||
case BPF_ALU64 | BPF_MOD | BPF_X: | ||
ctx->tmp_used = 1; | ||
emit(A64_UDIV(is64, tmp, dst, src), ctx); | ||
emit(A64_MUL(is64, tmp, tmp, src), ctx); | ||
emit(A64_SUB(is64, dst, dst, tmp), ctx); | ||
{ | ||
const u8 r0 = bpf2a64[BPF_REG_0]; | ||
|
||
/* if (src == 0) return 0 */ | ||
jmp_offset = 3; /* skip ahead to else path */ | ||
check_imm19(jmp_offset); | ||
emit(A64_CBNZ(is64, src, jmp_offset), ctx); | ||
emit(A64_MOVZ(1, r0, 0, 0), ctx); | ||
jmp_offset = epilogue_offset(ctx); | ||
check_imm26(jmp_offset); | ||
emit(A64_B(jmp_offset), ctx); | ||
/* else */ | ||
switch (BPF_OP(code)) { | ||
case BPF_DIV: | ||
emit(A64_UDIV(is64, dst, dst, src), ctx); | ||
break; | ||
case BPF_MOD: | ||
ctx->tmp_used = 1; | ||
emit(A64_UDIV(is64, tmp, dst, src), ctx); | ||
emit(A64_MUL(is64, tmp, tmp, src), ctx); | ||
emit(A64_SUB(is64, dst, dst, tmp), ctx); | ||
break; | ||
} | ||
break; | ||
} | ||
case BPF_ALU | BPF_LSH | BPF_X: | ||
case BPF_ALU64 | BPF_LSH | BPF_X: | ||
emit(A64_LSLV(is64, dst, dst, src), ctx); | ||
|
@@ -393,17 +422,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | |
emit(A64_ASR(is64, dst, dst, imm), ctx); | ||
break; | ||
|
||
#define check_imm(bits, imm) do { \ | ||
if ((((imm) > 0) && ((imm) >> (bits))) || \ | ||
(((imm) < 0) && (~(imm) >> (bits)))) { \ | ||
pr_info("[%2d] imm=%d(0x%x) out of range\n", \ | ||
i, imm, imm); \ | ||
return -EINVAL; \ | ||
} \ | ||
} while (0) | ||
#define check_imm19(imm) check_imm(19, imm) | ||
#define check_imm26(imm) check_imm(26, imm) | ||
|
||
/* JUMP off */ | ||
case BPF_JMP | BPF_JA: | ||
jmp_offset = bpf2a64_offset(i + off, i, ctx); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.