@@ -54,7 +54,6 @@
#define SEEN_DATA (1 << (BPF_MEMWORDS + 3))
#define FLAG_NEED_X_RESET (1 << 0)
-#define FLAG_IMM_OVERFLOW (1 << 1)
struct jit_ctx {
const struct sk_filter *skf;
@@ -294,15 +293,6 @@ static u16 imm_offset(u32 k, struct jit_ctx *ctx)
/* PC in ARM mode == address of the instruction + 8 */
imm = offset - (8 + ctx->idx * 4);
- if (imm & ~0xfff) {
- /*
- * literal pool is too far, signal it into flags. we
- * can only detect it on the second pass unfortunately.
- */
- ctx->flags |= FLAG_IMM_OVERFLOW;
- return 0;
- }
-
return imm;
}
@@ -873,14 +863,6 @@ b_epilogue:
default:
return -1;
}
-
- if (ctx->flags & FLAG_IMM_OVERFLOW)
- /*
- * this instruction generated an overflow when
- * trying to access the literal pool, so
- * delegate this filter to the kernel interpreter.
- */
- return -1;
}
/* compute offsets only during the first pass */
@@ -939,14 +921,7 @@ void bpf_jit_compile(struct sk_filter *fp)
ctx.idx = 0;
build_prologue(&ctx);
- if (build_body(&ctx) < 0) {
-#if __LINUX_ARM_ARCH__ < 7
- if (ctx.imm_count)
- kfree(ctx.imms);
-#endif
- bpf_jit_binary_free(header);
- goto out;
- }
+ build_body(&ctx);
build_epilogue(&ctx);
flush_icache_range((u32)ctx.target, (u32)(ctx.target + ctx.idx));