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=-3.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_GIT 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 24366C169C4 for ; Sun, 3 Feb 2019 11:52:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E316C21773 for ; Sun, 3 Feb 2019 11:52:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k0doAk9b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727595AbfBCLwh (ORCPT ); Sun, 3 Feb 2019 06:52:37 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38222 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727446AbfBCLwh (ORCPT ); Sun, 3 Feb 2019 06:52:37 -0500 Received: by mail-ed1-f68.google.com with SMTP id h50so8999324ede.5 for ; Sun, 03 Feb 2019 03:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mYxMbHIquM6UE8/rcw8KlfN7w2I5ecQu1rL8ri42f8Y=; b=k0doAk9bvEXjTy0LU7qd91j6uKmhSastdKyokfRZ3tv6Iht8GG5EgQuMYKNh14Ov/a g+kYyQdR4nkQ5ALgGUxW4UmCsu97iujVUtJhUQWH8yXAO9HAG7QOph/BTTcjkiPMVkBd fTUl3hUG1HuU+nft2QKKfQyahYqVy9e1lTRHnnmDGBUqwHoT2pyBP2FpOaN5TNTVT7r4 hr4NY37tejLUuCLZ68gMAAIIrc/kUqGYN+P2PhghVu/E3dRyuQqPAhjTiT0InyjKWrW7 B7U4y6jj9RlbkdUwTih6iKWorkVkQkmstJWei5cWdgpyRjqawj+8B+4WPsYzOiqRpafz 5O0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mYxMbHIquM6UE8/rcw8KlfN7w2I5ecQu1rL8ri42f8Y=; b=Ra6vwaifGF0JVT6ClAcAVjzSGANNDtg4jSTU6VHGCF9m/R8L7JERd3dBo/DUXEHNhY fm+qeEmIpzrTtz6dkYGPbUGqClwnrPB8N+0MSE4dXDVYp14pzMiXxHSRPf9zP8/Xr5+G A1fzgvgBEnbI0/D6SYkNTBemkiN9pY9MaCnrxr4O5r9GWgUju2Zmi4pTiy7U5a5iTpqu GLXjYtTiB+Cqz0IcsL/B7yOY5od1mn2RSCAkkS0DIVAWclRfC0LF1AB6ID8PKDOhgzrn OynBmJUj95i8BuPbDmsyLUlufOS+7X4zNbQev7wk15MQykjQdc+BoY8d9YqMNMZJ6hmC xsIA== X-Gm-Message-State: AJcUukeKrX4YoGzFLw4vu8f9mu7D12pWnrq0AaduXacEjxI/4ATeJEgV LndyIx60myr7jJ8R4Tl3Des= X-Google-Smtp-Source: ALg8bN66oNGItKp9jW0Oe61h/frEANmzCUMoNBlSgDXX4pQ8XtEPHIyx8jEdu0KojCYrLnpTqlNFCA== X-Received: by 2002:a50:a642:: with SMTP id d60mr47296716edc.290.1549194755396; Sun, 03 Feb 2019 03:52:35 -0800 (PST) Received: from btopel-mobl.ger.intel.com ([2001:67c:1810:f055:c82b:bcf5:1add:2ef0]) by smtp.gmail.com with ESMTPSA id l10sm2120719ejq.55.2019.02.03.03.52.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 03:52:34 -0800 (PST) From: bjorn.topel@gmail.com To: linux-riscv@lists.infradead.org, daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org Cc: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , palmer@sifive.com, hch@infradead.org Subject: [PATCH bpf-next 0/3] Add RISC-V (RV64G) BPF JIT Date: Sun, 3 Feb 2019 12:51:28 +0100 Message-Id: <20190203115132.8766-1-bjorn.topel@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Björn Töpel Hi! This series adds an RV64G BPF JIT to the kernel. I've sent out a RFC for a couple of weeks ago, and think this code is feature-complete/stable enough (famous last words) for a proper patch. Unfortunately, kprobes isn't supported by RISC-V yet (Patrick Stählin sent out an RFC last year), which means that all tests involving BPF_PROG_TYPE_TRACEPOINT, BPF_PROG_TYPE_PERF_EVENT, BPF_PROG_TYPE_KPROBE and BPF_PROG_TYPE_RAW_TRACEPOINT will fail. Further, the implementation does not support "far branching" (>4KiB). The implementation passes all the test_bpf.ko tests: test_bpf: Summary: 378 PASSED, 0 FAILED, [366/366 JIT'ed] All the tail_call tests in the selftest/bpf/test_verifier program passes. All tests where done on QEMU emulator version 3.1.50 (v3.1.0-688-g8ae951fbc106). I'll test it on real hardware, when I get access to it. I'm routing this patch via bpf-next/netdev mailing list (after a conversation with Palmer at FOSDEM), mainly because the other JITs went that path. Thanks for all the comments! Cheers, Björn RFCv1 -> v1: * Cleaned up the Kconfig and net/Makefile. (Christoph) * Removed the entry-stub and squashed the build/config changes to be part of the JIT implementation. (Christoph) * Simplified the register tracking code. (Daniel) * Removed unused macros. (Daniel) * Added myself as maintainer and updated documentation. (Daniel) * Removed HAVE_EFFICIENT_UNALIGNED_ACCESS. (Christoph, Palmer) * Added tail-calls and cleaned up the code. Björn Töpel (3): bpf, riscv: add BPF JIT for RV64G MAINTAINERS: add RISC-V BPF JIT maintainer bpf, doc: add RISC-V to filter.txt Documentation/networking/filter.txt | 16 +- MAINTAINERS | 6 + arch/riscv/Kconfig | 1 + arch/riscv/Makefile | 2 +- arch/riscv/net/Makefile | 1 + arch/riscv/net/bpf_jit_comp.c | 1502 +++++++++++++++++++++++++++ 6 files changed, 1520 insertions(+), 8 deletions(-) create mode 100644 arch/riscv/net/Makefile create mode 100644 arch/riscv/net/bpf_jit_comp.c -- 2.19.1