From patchwork Wed Sep 13 15:34:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pu Lehui X-Patchwork-Id: 13383329 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCA99639; Wed, 13 Sep 2023 15:33:54 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B406E3; Wed, 13 Sep 2023 08:33:53 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Rm4HG233rz4f3jrq; Wed, 13 Sep 2023 23:33:46 +0800 (CST) Received: from ultra.huawei.com (unknown [10.90.53.71]) by APP2 (Coremail) with SMTP id Syh0CgAXIAVd1gFltNV8AQ--.25893S2; Wed, 13 Sep 2023 23:33:50 +0800 (CST) From: Pu Lehui To: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Palmer Dabbelt , Luke Nelson , Pu Lehui , Pu Lehui Subject: [PATCH bpf-next 0/6] Zbb support and code simplification for RV64 JIT Date: Wed, 13 Sep 2023 23:34:07 +0800 Message-Id: <20230913153413.1446068-1-pulehui@huaweicloud.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAXIAVd1gFltNV8AQ--.25893S2 X-Coremail-Antispam: 1UD129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flected X-Patchwork-Delegate: bpf@iogearbox.net Add Zbb support [0] to optimize code size and performance of RV64 JIT. Meanwhile, adjust the code for unification and simplification. Tests test_bpf.ko and test_verifier have passed, as well as the relative testcases of test_progs*. [0] https://github.com/riscv/riscv-bitmanip/releases/download/1.0.0/bitmanip-1.0.0-38-g865e7a7.pdf Pu Lehui (6): riscv, bpf: Unify 32-bit sign-extension to emit_sextw riscv, bpf: Unify 32-bit zero-extension to emit_zextw riscv, bpf: Simplify sext and zext logics in branch instructions riscv, bpf: Add necessary Zbb instructions riscv, bpf: Optimize sign-extention mov insns with Zbb support riscv, bpf: Optimize bswap insns with Zbb support arch/riscv/net/bpf_jit.h | 123 ++++++++++++++++++ arch/riscv/net/bpf_jit_comp64.c | 213 +++++++++++--------------------- 2 files changed, 194 insertions(+), 142 deletions(-)