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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 30E4EC282C0 for ; Fri, 25 Jan 2019 19:02:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00EE0218D0 for ; Fri, 25 Jan 2019 19:02:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="FO2wh0vF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbfAYTCF (ORCPT ); Fri, 25 Jan 2019 14:02:05 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41591 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbfAYTCF (ORCPT ); Fri, 25 Jan 2019 14:02:05 -0500 Received: by mail-pl1-f193.google.com with SMTP id u6so4960413plm.8 for ; Fri, 25 Jan 2019 11:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=+gNsjMty4+NnX4KJE2TASNpDaKslYckTzSCUo/A5E2c=; b=FO2wh0vFVqrT8n7Oh0u09fKifxKR4owkwY2+uFsJwtT7+hku37LPOBjUVbkyl5rBWK V82ghp2magITJg2qM/kMex5JEiFtS2nRifk+XZaQRz0xlk9erz5JlFV0SuOqlFrDc0Z4 w0rshdNTXGwBQJLvYwPqDzBocGneJjOXAUP6SpQj3sRfrHgzgsISqAQ/CPPmBD7inG1n xGcifATWXyFUWIDoICCUp2ezBs1VzPS/RS06nmnUGE2oE5GSKgVjEeYNF/eGoZYCGQec koHleBWooO77nafc2Qf3ZaEWs0dqOXeGPYe7mq3XoqP8y4fQKKjWcUrqOpub2tFowLtR WoCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=+gNsjMty4+NnX4KJE2TASNpDaKslYckTzSCUo/A5E2c=; b=ZOZPCJaZUZkaYbnKfvb4/+pEx/oezrMWOJnU/kxYtNYJIw8DqiTrLIgk1sbNBFAFc1 MK6btEpyK19daPQ0T4dKA5pytRk0b2ZZlzdQWC+ZsTeuIWtk0897CchL+Ultl+iDb6AC +lA5GHLFcQggJRZyFpCa8aNycuJ4vxaC6FdamwPoePQ9+xzYMRoqGbHB7Zgyk/xS5A/P 3dTFiGPA0pNcIVQWvSNIc54zCk5nPxPh0Ld/1ZZy4oTYziy64Gjy4u8triFoh3ruvWrZ YRT/PMgZ+16eaBLG37mF8743wjlUZlQdWEbeQo8dEKcgg1Ew0cL4p8erjYUygsOv6lcq 0iaw== X-Gm-Message-State: AJcUukcDQZQjlMCEd3TBKicos1qrZfuFjiKh2bB3xZygMHl+eh5w3/EP urcQzY0JvZiSKXuar/g7YvrhuQ== X-Google-Smtp-Source: ALg8bN7s8sltODOH4z34wdbWP4SUBk5D3rQA17csB4JRK7lqcarqnkR8zHXZ33MolZjBAlGz8ACBow== X-Received: by 2002:a17:902:20c6:: with SMTP id v6mr12310793plg.156.1548442924731; Fri, 25 Jan 2019 11:02:04 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id w10sm28855005pgi.81.2019.01.25.11.02.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 11:02:03 -0800 (PST) Date: Fri, 25 Jan 2019 11:02:03 -0800 (PST) X-Google-Original-Date: Fri, 25 Jan 2019 10:58:41 PST (-0800) Subject: Re: [RFC PATCH 0/3] RV64G eBPF JIT In-Reply-To: CC: Christoph Hellwig , linux-riscv@lists.infradead.org, davidlee@sifive.com, daniel@iogearbox.net, netdev@vger.kernel.org From: Palmer Dabbelt To: bjorn.topel@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 15 Jan 2019 08:03:18 PST (-0800), bjorn.topel@gmail.com wrote: > Den tis 15 jan. 2019 kl 16:40 skrev Christoph Hellwig : >> >> Hi Björn, >> >> at least for me patch 3 didn't make it to the list. >> > > Hmm, held back: "Your message to linux-riscv awaits moderator > approval". Exceeded the 40k limit. > > I'll wait until the moderator wakes up (Palmer?). Sorry, it took me a while to wake up :) > > > Björn > >> On Tue, Jan 15, 2019 at 09:35:15AM +0100, Björn Töpel wrote: >> > Hi! >> > >> > I've been hacking on a RV64G eBPF JIT compiler, and would like some >> > feedback. >> > >> > Codewise, it needs some refactoring. Currently there's a bit too much >> > copy-and-paste going on, and I know some places where I could optimize >> > the code generation a bit (mostly BPF_K type of instructions, dealing >> > with immediates). >> > >> > From a features perspective, two things are missing: >> > >> > * tail calls >> > * "far-branches", i.e. conditional branches that reach beyond 13b. >> > >> > The test_bpf.ko (only tested on 4.20!) passes all tests. >> > >> > I've done all the tests on QEMU (version 3.1.50), so no real hardware. >> > >> > Some questions/observations: >> > >> > * I've added "HAVE_EFFICIENT_UNALIGNED_ACCESS" to >> > arch/riscv/Kconfig. Is this assumption correct? >> > >> > * emit_imm() just relies on lui, adds and shifts. No fancy xori cost >> > optimizations like GCC does. >> > >> > * Suggestions on how to implement the tail call, given that the >> > prologue/epilogue has variable size. I will dig into the details of >> > mips/arm64/x86. :-) >> > >> > Next steps (prior patch proper) is cleaning up the code, add tail >> > calls, and making sure that bpftool disassembly works correctly. >> > >> > All input are welcome. This is my first RISC-V hack, so I sure there >> > are a lot things to improve! >> > >> > >> > Thanks, >> > Björn >> > >> > >> > Björn Töpel (3): >> > riscv: set HAVE_EFFICIENT_UNALIGNED_ACCESS >> > riscv: add build infra for JIT compiler >> > bpf, riscv: added eBPF JIT for RV64G >> > >> > arch/riscv/Kconfig | 2 + >> > arch/riscv/Makefile | 4 + >> > arch/riscv/net/Makefile | 5 + >> > arch/riscv/net/bpf_jit_comp.c | 1612 +++++++++++++++++++++++++++++++++ >> > 4 files changed, 1623 insertions(+) >> > create mode 100644 arch/riscv/net/Makefile >> > create mode 100644 arch/riscv/net/bpf_jit_comp.c >> > >> > -- >> > 2.19.1 >> > >> > >> > _______________________________________________ >> > linux-riscv mailing list >> > linux-riscv@lists.infradead.org >> > http://lists.infradead.org/mailman/listinfo/linux-riscv >> ---end quoted text---