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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A63DFC43334 for ; Sat, 9 Jul 2022 01:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229491AbiGIBB3 (ORCPT ); Fri, 8 Jul 2022 21:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiGIBB2 (ORCPT ); Fri, 8 Jul 2022 21:01:28 -0400 Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F3A725A1; Fri, 8 Jul 2022 18:01:27 -0700 (PDT) Date: Sat, 9 Jul 2022 09:01:10 +0800 From: Yixun Lan To: Christoph Hellwig Cc: Yonghong Song , Andrii Nakryiko , Alan Maguire , Palmer Dabbelt , linux-riscv@lists.infradead.org, Paul Walmsley , Albert Ou , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , open list , Networking , bpf Subject: Re: [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}() Message-ID: References: <20220703130924.57240-1-dlan@gentoo.org> <712c8fac-6784-2acd-66ca-d1fd393aef23@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Christoph, YongHong On 00:01 Wed 06 Jul , Christoph Hellwig wrote: > On Tue, Jul 05, 2022 at 11:41:30PM -0700, Yonghong Song wrote: > > > > > > On 7/5/22 10:00 PM, Andrii Nakryiko wrote: > > > On Sun, Jul 3, 2022 at 10:53 PM Christoph Hellwig wrote: > > > > > > > > On Sun, Jul 03, 2022 at 09:09:24PM +0800, Yixun Lan wrote: > > > > > Enable this option to fix a bcc error in RISC-V platform > > > > > > > > > > And, the error shows as follows: > > > > > > > > These should not be enabled on new platforms. Use the proper helpers > > > > to probe kernel vs user pointers instead. > > > > > > riscv existed as of [0], so I'd argue it is a proper bug fix, as > > > corresponding select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE should > > > have been added back then. > > > > > > But I also agree that BCC tools should be updated to use proper > > > bpf_probe_read_{kernel,user}[_str()] helpers, please contribute such > > > fixes to BCC tools and BCC itself as well. Cc'ed Alan as his ksnoop in > > > libbpf-tools seems to be using bpf_probe_read() as well and needs to > > > be fixed. > > > > Yixun, the bcc change looks like below: > > No, this is broken. bcc needs to stop using bpf_probe_read entirely > for user addresses and unconditionally use bpf_probe_read_user first > and only fall back to bpf_probe_read if not supported. I agree with Christoph, there is something in the bcc tools that need to adjust in order to use new bpf_probe_read_{kernel,user} Please check the ongoing discussion [0] in the bcc tools if you're interested in, advice and comments are welcome [0] https://github.com/iovisor/bcc/pull/4085#issuecomment-1179446738 -- Yixun Lan (dlan) Gentoo Linux Developer GPG Key ID AABEFD55