Message ID | 20240622022129.3844473-1-pulehui@huaweicloud.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72380C2BB85 for <linux-riscv@archiver.kernel.org>; Sat, 22 Jun 2024 02:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pdND7/cmtVfPEaxWfNWYrh0GPtKhZN6IWbnqlMcjloQ=; b=YvgnVuddneHzvK U0NgTRR25/RIlzqd0AuhKcyLmLDzMwipG+DCe9pXWnWuxwfw4edYGVcG/NWLzKUynrDoSs8j3xfDM 6Z1b5n51NdoAGBA/eVHrQHjvpRbAJiYwdzoXjberNxsDt/jIA6DzElnTl+xU3oDftInbN21YNrZYD Fdh3mRCfwxUdnVGEdFUkGOnemY5ePtvgnZwukm3cQ736ThZvSa/0XVQvreXJ5HqiSvMaFpCpmBl9s uPgrue0pXhbZf9JGpgmEUP7uFwUy8GrhtdQvciu70mqrDQpWq9sjs36Rb6ZnuFICw3wjE1pEQisoz WtcysST5Db/iFS5hnTEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKqMP-0000000BBCy-2EOF; Sat, 22 Jun 2024 02:20:13 +0000 Received: from dggsgout11.his.huawei.com ([45.249.212.51]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKqML-0000000BBAf-2WRl for linux-riscv@lists.infradead.org; Sat, 22 Jun 2024 02:20:11 +0000 Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4W5dGS3gBXz4f3kw0 for <linux-riscv@lists.infradead.org>; Sat, 22 Jun 2024 10:19:44 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 70A1D1A0187 for <linux-riscv@lists.infradead.org>; Sat, 22 Jun 2024 10:19:56 +0800 (CST) Received: from ultra.huawei.com (unknown [10.90.53.71]) by APP1 (Coremail) with SMTP id cCh0CgCnPK7INHZmmlBiAg--.22370S2; Sat, 22 Jun 2024 10:19:53 +0800 (CST) From: Pu Lehui <pulehui@huaweicloud.com> To: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= <bjorn@kernel.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>, John Fastabend <john.fastabend@gmail.com>, KP Singh <kpsingh@kernel.org>, Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>, Puranjay Mohan <puranjay@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>, Pu Lehui <pulehui@huawei.com> Subject: [PATCH RESEND bpf-next v4 0/3] Add 12-argument support for RV64 bpf trampoline Date: Sat, 22 Jun 2024 02:21:26 +0000 Message-Id: <20240622022129.3844473-1-pulehui@huaweicloud.com> X-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JbIYCTnIWIevJa73UjIFyTuYvjxUFDGOUUUUU X-CM-SenderInfo: psxovxtxl6x35dzhxuhorxvhhfrp/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_192010_149295_EF7DD9D8 X-CRM114-Status: UNSURE ( 7.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-riscv/> List-Post: <mailto:linux-riscv@lists.infradead.org> List-Help: <mailto:linux-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" <linux-riscv-bounces@lists.infradead.org> Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org |
Series |
Add 12-argument support for RV64 bpf trampoline
|
expand
|
From: Pu Lehui <pulehui@huawei.com> This patch adds 12 function arguments support for riscv64 bpf trampoline. The current bpf trampoline supports <= sizeof(u64) bytes scalar arguments [0] and <= 16 bytes struct arguments [1]. Therefore, we focus on the situation where scalars are at most XLEN bits and aggregates whose total size does not exceed 2×XLEN bits in the riscv calling convention [2]. Link: https://elixir.bootlin.com/linux/v6.8/source/kernel/bpf/btf.c#L6184 [0] Link: https://elixir.bootlin.com/linux/v6.8/source/kernel/bpf/btf.c#L6769 [1] Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/download/draft-20230929-e5c800e661a53efe3c2678d71a306323b60eb13b/riscv-abi.pdf [2] v4: - Separate many args test logic from tracing_struct. (Daniel) v3: https://lore.kernel.org/all/20240403072818.1462811-1-pulehui@huaweicloud.com/ - Variable and macro name alignment: nr_reg_args: number of args in reg nr_stack_args: number of args on stack RV_MAX_REG_ARGS: macro for riscv max args in reg v2: https://lore.kernel.org/all/20240403041710.1416369-1-pulehui@huaweicloud.com/ - Add tracing_struct to DENYLIST.aarch64 while aarch64 does not yet support bpf trampoline with more than 8 args. - Change the macro RV_MAX_ARG_REGS to RV_MAX_ARGS_REG to synchronize with the variable definition below. - Add some comments for stk_arg_off and magic number of skip slots for loading args on stack. v1: https://lore.kernel.org/all/20240331092405.822571-1-pulehui@huaweicloud.com/ Pu Lehui (3): riscv, bpf: Add 12-argument support for RV64 bpf trampoline selftests/bpf: Factor out many args tests from tracing_struct selftests/bpf: Add testcase where 7th argment is struct arch/riscv/net/bpf_jit_comp64.c | 66 +++++++++---- tools/testing/selftests/bpf/DENYLIST.aarch64 | 1 + .../selftests/bpf/bpf_testmod/bpf_testmod.c | 19 ++++ .../selftests/bpf/prog_tests/tracing_struct.c | 46 ++++++++- .../selftests/bpf/progs/tracing_struct.c | 54 ----------- .../bpf/progs/tracing_struct_many_args.c | 97 +++++++++++++++++++ 6 files changed, 206 insertions(+), 77 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/tracing_struct_many_args.c