From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F985C43603 for ; Mon, 9 Dec 2019 21:27:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29197206E0 for ; Mon, 9 Dec 2019 21:27:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbfLIV1e (ORCPT ); Mon, 9 Dec 2019 16:27:34 -0500 Received: from www62.your-server.de ([213.133.104.62]:52316 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfLIV1e (ORCPT ); Mon, 9 Dec 2019 16:27:34 -0500 Received: from sslproxy02.your-server.de ([78.47.166.47]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1ieQYz-0005UU-5g; Mon, 09 Dec 2019 22:27:29 +0100 Received: from [178.197.249.52] (helo=pc-9.home) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ieQYy-000RvL-Qi; Mon, 09 Dec 2019 22:27:28 +0100 Subject: Re: [PATCH bpf-next 2/8] riscv, bpf: add support for far branching To: Luke Nelson , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Alexei Starovoitov , Netdev , linux-riscv@lists.infradead.org, bpf , Xi Wang References: <20191209173136.29615-1-bjorn.topel@gmail.com> <20191209173136.29615-3-bjorn.topel@gmail.com> From: Daniel Borkmann Message-ID: <2d5d1f2d-d4ab-2449-37c6-e5b319a778d6@iogearbox.net> Date: Mon, 9 Dec 2019 22:27:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.101.4/25658/Mon Dec 9 10:47:26 2019) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 12/9/19 10:08 PM, Luke Nelson wrote: [...] > We have been developing a formal verification tool for BPF JIT > compilers, which we have used in the past to find bugs in the RV64 > and x32 BPF JITs: > > https://unsat.cs.washington.edu/projects/serval/ > > Recently I added support for verifying the JIT for branch and jump > instructions, and thought it a good opportunity to verify these > patches that add support for far jumps and branching. > > I ported these patches to our tool and ran verification, which > didn't find any bugs according to our specification of BPF and > RISC-V. > > The tool and code are publicly available, and you can read a more > detailed writeup of the results here: > > https://github.com/uw-unsat/bpf-jit-verif/tree/far-jump-review > > Currently the tool works on a manually translated version of the > JIT from C to Rosette, but we are experimenting with ways of making > this process more automated. This is awesome work! Did you also check for other architectures aside from riscv and x86-32, e.g. x86-64 or arm64? It would be great if we could add such verification tool under tools/bpf/ which would then take the in-tree JIT-code as-is for its analysis and potentially even trigger a run out of BPF selftests. Any thoughts whether such path would be feasible wrt serval? > Reviewed-by: Luke Nelson > Cc: Xi Wang Thanks, Daniel