From nobody Sun Apr 19 10:42:38 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B80E1C433EF for ; Sun, 3 Jul 2022 13:09:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232303AbiGCNJt (ORCPT ); Sun, 3 Jul 2022 09:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiGCNJs (ORCPT ); Sun, 3 Jul 2022 09:09:48 -0400 Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85CDC6350; Sun, 3 Jul 2022 06:09:44 -0700 (PDT) From: Yixun Lan To: Palmer Dabbelt , linux-riscv@lists.infradead.org Cc: Paul Walmsley , Albert Ou , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Yixun Lan Subject: [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}() Date: Sun, 3 Jul 2022 21:09:24 +0800 Message-Id: <20220703130924.57240-1-dlan@gentoo.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Enable this option to fix a bcc error in RISC-V platform And, the error shows as follows: ~ # runqlen WARNING: This target JIT is not designed for the host you are running. \ If bad things happen, please choose a different -march switch. bpf: Failed to load program: Invalid argument 0: R1=3Dctx(off=3D0,imm=3D0) R10=3Dfp0 0: (85) call bpf_get_current_task#35 ; R0_w=3Dscalar() 1: (b7) r6 =3D 0 ; R6_w=3D0 2: (7b) *(u64 *)(r10 -8) =3D r6 ; R6_w=3DP0 R10=3Dfp0 fp-8_w=3D0000= 0000 3: (07) r0 +=3D 312 ; R0_w=3Dscalar() 4: (bf) r1 =3D r10 ; R1_w=3Dfp0 R10=3Dfp0 5: (07) r1 +=3D -8 ; R1_w=3Dfp-8 6: (b7) r2 =3D 8 ; R2_w=3D8 7: (bf) r3 =3D r0 ; R0_w=3Dscalar(id=3D1) R3_w=3Dscal= ar(id=3D1) 8: (85) call bpf_probe_read#4 unknown func bpf_probe_read#4 processed 9 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak= _states 0 mark_read 0 Traceback (most recent call last): File "/usr/lib/python-exec/python3.9/runqlen", line 187, in b.attach_perf_event(ev_type=3DPerfType.SOFTWARE, File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 1228, in at= tach_perf_event fn =3D self.load_func(fn_name, BPF.PERF_EVENT) File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 522, in loa= d_func raise Exception("Failed to load BPF program %s: %s" % Exception: Failed to load BPF program b'do_perf_event': Invalid argument Signed-off-by: Yixun Lan --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 32ffef9f6e5b4..da0016f1be6ce 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -25,6 +25,7 @@ config RISCV select ARCH_HAS_GIGANTIC_PAGE select ARCH_HAS_KCOV select ARCH_HAS_MMIOWB + select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SET_DIRECT_MAP if MMU select ARCH_HAS_SET_MEMORY if MMU --=20 2.35.1