Re: [PATCH 2/4] test_bpf: Add test to make conditional jump cross a large number of insns.

From: Daniel Borkmann
Date: Tue Jun 13 2017 - 20:20:27 EST


On 06/14/2017 01:49 AM, David Daney wrote:
On MIPS, conditional branches can only span 32k instructions. To
exceed this limit in the JIT with the BPF maximum of 4k insns, we need
to choose eBPF insns that expand to more than 8 machine instructions.
Use BPF_LD_ABS as it is quite complex. This forces the JIT to invert
the sense of the branch to branch around a long jump to the end.

This (somewhat) verifies that the branch inversion logic and target
address calculation of the long jumps are done correctly.

Signed-off-by: David Daney <david.daney@xxxxxxxxxx>

Acked-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>