From: Linus Torvalds Date: Tue, 5 Jun 2018 02:17:47 +0000 (-0700) Subject: Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel... X-Git-Tag: v4.18-rc1~160 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0afe832e55a70f4bc5e725db400779b4f620290c;p=users%2Fhch%2Fxfs.git Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Ingo Molnar: "Misc cleanups" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apm: Fix spelling mistake: "caculate" -> "calculate" x86/mtrr: Rename main.c to mtrr.c and remove duplicate prefixes x86: Remove pr_fmt duplicate logging prefixes x86/early-quirks: Rename duplicate define of dev_err x86/bpf: Clean up non-standard comments, to make the code more readable --- 0afe832e55a70f4bc5e725db400779b4f620290c diff --cc arch/x86/net/bpf_jit_comp.c index 263c8453815e,ac4df93d4105..d765acedc05c --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@@ -1027,19 -1055,9 +1055,19 @@@ emit_cond_jmp: /* Convert BPF opcode t break; case BPF_JMP | BPF_JA: - jmp_offset = addrs[i + insn->off] - addrs[i]; + if (insn->off == -1) + /* -1 jmp instructions will always jump + * backwards two bytes. Explicitly handling + * this case avoids wasting too many passes + * when there are long sequences of replaced + * dead code. + */ + jmp_offset = -2; + else + jmp_offset = addrs[i + insn->off] - addrs[i]; + if (!jmp_offset) - /* optimize out nop jumps */ + /* Optimize out nop jumps */ break; emit_jmp: if (is_imm8(jmp_offset)) {