From patchwork Wed Oct 4 11:09:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13408622 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 92A3611CAC; Wed, 4 Oct 2023 11:09:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C585C433C9; Wed, 4 Oct 2023 11:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696417760; bh=jGyGtT5hAh42qtvFtybeGnz3fQgWG1+/lAX0yi2x8O8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A2+JdAq5zMOxCIhi934DYXVOPUrdLAN0OhjgKkaF8dg3YRTPwRl1F3pfkomGYZgAQ EqzxEdPjNQwzhw7+Nz2HIQIEO05y1Ly1RhqO3Rxqh7444Wr7O16K8h/1YGcTL2Q2Pp 6fYLNDX8mP90Stu3hpAAvpIykIDKAgihGY5cJqAGPXMFIpeLC85BTVWAYhtlwi7EdQ oh79sWjywQtALxIeAYreihREuB3lq2vDSgsrxxPK9D/Wc8Ghv0vrupLdrcOOFnjt6T WIqTb/NAoYWRS/DxRyb1GSMMvnMWl7y1oYN1zAhM7iHDTSmpAJ2sJM6RwsugbKY1Ft vut536vQASvAg== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: Alexandre Ghiti , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Sami Tolvanen Subject: [PATCH bpf 1/3] libbpf: Fix syscall access arguments on riscv Date: Wed, 4 Oct 2023 13:09:03 +0200 Message-Id: <20231004110905.49024-2-bjorn@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004110905.49024-1-bjorn@kernel.org> References: <20231004110905.49024-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Alexandre Ghiti Since commit 08d0ce30e0e4 ("riscv: Implement syscall wrappers"), riscv selects ARCH_HAS_SYSCALL_WRAPPER so let's use the generic implementation of PT_REGS_SYSCALL_REGS(). Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers") Signed-off-by: Alexandre Ghiti --- tools/lib/bpf/bpf_tracing.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index 3803479dbe10..1c13f8e88833 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -362,8 +362,6 @@ struct pt_regs___arm64 { #define __PT_PARM7_REG a6 #define __PT_PARM8_REG a7 -/* riscv does not select ARCH_HAS_SYSCALL_WRAPPER. */ -#define PT_REGS_SYSCALL_REGS(ctx) ctx #define __PT_PARM1_SYSCALL_REG __PT_PARM1_REG #define __PT_PARM2_SYSCALL_REG __PT_PARM2_REG #define __PT_PARM3_SYSCALL_REG __PT_PARM3_REG From patchwork Wed Oct 4 11:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13408623 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 78C1512B76; Wed, 4 Oct 2023 11:09:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D630FC433CA; Wed, 4 Oct 2023 11:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696417763; bh=WpGCVlyEgOw4b2FaJcUO9+9LMMvSL9a+ezCXN7JxYNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V5k4ZMhEzkCz2qXAkxEoYJrNjM1+W8E/LToiXc3tpQtiJGUS/7/LCJrOpti+PO+b5 1emXGUbnb/Aj5AIejFtuvRfYRSBkNYeKFihj0u0vSEZfP4fFbXxqiS50u/vtsn6G4p O3QeOz7VFOYQmT2uyv9GmaVJeyI87MHAEcoA6xOrrd70E8/KUYRpKmCxg5sNFlkzEt 2Yy2ySLGpFJLwu9mUxH2W/4mNqMBwqa3EsRtwAbMEKtwXvhL9+Un6pqgLzIvWPySCP 7nN+g9/9BAv1R92zn+bWDJT3c59d4bEfN//vHcmgMaWzHIYIOph4TppgWGE78qZRdG tGrk4oBUCyBcQ== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Sami Tolvanen Subject: [PATCH bpf 2/3] selftests/bpf: Define SYS_PREFIX for riscv Date: Wed, 4 Oct 2023 13:09:04 +0200 Message-Id: <20231004110905.49024-3-bjorn@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004110905.49024-1-bjorn@kernel.org> References: <20231004110905.49024-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Björn Töpel SYS_PREFIX was missing for a RISC-V, which made a couple of kprobe tests fail. Add missing SYS_PREFIX for RISC-V. Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers") Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/progs/bpf_misc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h index 38a57a2e70db..799fff4995d8 100644 --- a/tools/testing/selftests/bpf/progs/bpf_misc.h +++ b/tools/testing/selftests/bpf/progs/bpf_misc.h @@ -99,6 +99,9 @@ #elif defined(__TARGET_ARCH_arm64) #define SYSCALL_WRAPPER 1 #define SYS_PREFIX "__arm64_" +#elif defined(__TARGET_ARCH_riscv) +#define SYSCALL_WRAPPER 1 +#define SYS_PREFIX "__riscv_" #else #define SYSCALL_WRAPPER 0 #define SYS_PREFIX "__se_" From patchwork Wed Oct 4 11:09:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13408624 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F20CA11C94; Wed, 4 Oct 2023 11:09:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B1A0C433C8; Wed, 4 Oct 2023 11:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696417765; bh=myfG9KhH8iXXI0iq3rgYVhXBywfTdM/2Q+7Ha1naXhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DdFm8es+jlF7PkHpEUfqa9RdXiSnnTrCJCr3asGKmQ25q7aDJqGiUuaAa/5qS7L9z sGjgLmcD4yf8vCIElGYnJZDBLO2K1qx71Kddj8zXqQkRr4jaTXHdL989/eoMzT3rbV 3BoQeM5AQxNS/B0ZM4opVnU/OmQG7o+DpGssD0CS5Cf7kWjb/uNoIAas6h/1cmXVzQ n2rh5Faki9Te07CC5tTf4S7dHCGVi1adx+VJ5aoZExoImpEwHz3g+m3LECzBWz5a84 /geVjpyVLCm7CVVLgmm3RPTFIfeYpMb/dF7l+Nc5SCS8n/vaIFapNiuXa2ATVXdeaD hmbttxzQ39OeQ== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Sami Tolvanen Subject: [PATCH bpf 3/3] selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for riscv Date: Wed, 4 Oct 2023 13:09:05 +0200 Message-Id: <20231004110905.49024-4-bjorn@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004110905.49024-1-bjorn@kernel.org> References: <20231004110905.49024-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Björn Töpel Add missing sys_nanosleep name for RISC-V, which is used by some tests (e.g. attach_probe). Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers") Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/test_progs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h index 77bd492c6024..2f9f6f250f17 100644 --- a/tools/testing/selftests/bpf/test_progs.h +++ b/tools/testing/selftests/bpf/test_progs.h @@ -417,6 +417,8 @@ int get_bpf_max_tramp_links(void); #define SYS_NANOSLEEP_KPROBE_NAME "__s390x_sys_nanosleep" #elif defined(__aarch64__) #define SYS_NANOSLEEP_KPROBE_NAME "__arm64_sys_nanosleep" +#elif defined(__riscv) +#define SYS_NANOSLEEP_KPROBE_NAME "__riscv_sys_nanosleep" #else #define SYS_NANOSLEEP_KPROBE_NAME "sys_nanosleep" #endif