Skip to content

Commit d1242b1

Browse files
iii-iAlexei Starovoitov
authored andcommitted
s390/bpf: Remove JITed image size limitations
Now that jump and long displacement ranges are no longer a problem, remove the limit on JITed image size. In practice it's still limited by 2G, but with verifier allowing "only" 1M instructions, it's not an issue. Signed-off-by: Ilya Leoshkevich <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent b25c57b commit d1242b1

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

arch/s390/net/bpf_jit_comp.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ struct bpf_jit {
5252
int labels[1]; /* Labels for local jumps */
5353
};
5454

55-
#define BPF_SIZE_MAX 0xffff /* Max size for program (16 bit branches) */
56-
5755
#define SEEN_MEM BIT(0) /* use mem[] for temporary storage */
5856
#define SEEN_LITERAL BIT(1) /* code uses literals */
5957
#define SEEN_FUNC BIT(2) /* calls C functions */
@@ -1631,11 +1629,6 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
16311629
/*
16321630
* Final pass: Allocate and generate program
16331631
*/
1634-
if (jit.size >= BPF_SIZE_MAX) {
1635-
fp = orig_fp;
1636-
goto free_addrs;
1637-
}
1638-
16391632
header = bpf_jit_binary_alloc(jit.size, &jit.prg_buf, 8, jit_fill_hole);
16401633
if (!header) {
16411634
fp = orig_fp;

0 commit comments

Comments
 (0)