aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-07-06 11:16:48 -0700
committerKevin Hilman <khilman@linaro.org>2015-07-06 11:16:48 -0700
commitc1c767d29bb2390308a35b69957b874e9446fe3b (patch)
tree6014e0b0838b2536c72452be4c5f5b2102922d04 /arch/x86/net/bpf_jit_comp.c
parent2cb9802eeb7f919f97df05b16ec128f4f5af366d (diff)
parent165797d05c15ab87ef7421c63a076ffa8477cbe4 (diff)
Merge tag 'v3.14.45' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.14lsk-v3.14-15.07
This is the 3.14.45 stable release
Diffstat (limited to 'arch/x86/net/bpf_jit_comp.c')
-rw-r--r--arch/x86/net/bpf_jit_comp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index af2d4317b218..1fed139f8eae 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -211,7 +211,12 @@ void bpf_jit_compile(struct sk_filter *fp)
}
cleanup_addr = proglen; /* epilogue address */
- for (pass = 0; pass < 10; pass++) {
+ /* JITed image shrinks with every pass and the loop iterates
+ * until the image stops shrinking. Very large bpf programs
+ * may converge on the last pass. In such case do one more
+ * pass to emit the final image
+ */
+ for (pass = 0; pass < 10 || image; pass++) {
u8 seen_or_pass0 = (pass == 0) ? (SEEN_XREG | SEEN_DATAREF | SEEN_MEM) : seen;
/* no prologue/epilogue for trivial filters (RET something) */
proglen = 0;