Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754055AbdFNAUX (ORCPT ); Tue, 13 Jun 2017 20:20:23 -0400 Received: from www62.your-server.de ([213.133.104.62]:39914 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753955AbdFNAUW (ORCPT ); Tue, 13 Jun 2017 20:20:22 -0400 Message-ID: <59408139.6010302@iogearbox.net> Date: Wed, 14 Jun 2017 02:20:09 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: David Daney , Alexei Starovoitov , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org CC: linux-mips@linux-mips.org, ralf@linux-mips.org Subject: Re: [PATCH 2/4] test_bpf: Add test to make conditional jump cross a large number of insns. References: <20170613234938.4823-1-david.daney@cavium.com> <20170613234938.4823-3-david.daney@cavium.com> In-Reply-To: <20170613234938.4823-3-david.daney@cavium.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 633 Lines: 13 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 Acked-by: Daniel Borkmann