Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1083491imw; Fri, 8 Jul 2022 18:33:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sNhX3NxCFPrY6I49/4fD9A4zJLTtylboji0EAAnf27yG3dGr+la5JrFtxYxJ2p9WjKrnwP X-Received: by 2002:a17:907:2cc1:b0:72b:1074:9629 with SMTP id hg1-20020a1709072cc100b0072b10749629mr6752201ejc.33.1657330417970; Fri, 08 Jul 2022 18:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657330417; cv=none; d=google.com; s=arc-20160816; b=pP2O3EpuZe8MsaZtG0eR47aevO7mNAqKZHrqYh8wUe7h8FYASfluxZwTyTQQFVaMWq NsENn4Yc2WlU4WLyMvMgK344gGPmhXr3Eg7MN1RQdZvmutj/E3WS7qW6xvyoKHvm5GsE G8CXeLtR4iYZXutePPztq861EcVUeuso+t968rSOCqND3Xm4YnWFkIJCDkCz4e7lSs53 0pdzwo1qbs+VGUu86fsW5zuoG5m6/MtjeZepkqen2IqWcTo6AOls2E5jDHcKthPw+6uq EQVH60J4JGYinp8NplOhcTbj+tL7LBNVq2aviFUkLhwLsnDEGRIFycQoubT4T9OQPZV1 rIWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nPkKsRvJsFdLNBuqGSfSPZvBAv3o4oHYgS2WGESYJYM=; b=Woq9+oC223G+m+8ilxHyQmNcaYSX1FtgFnauI8MmtTZsMFf9kpGBvBcgNE0L21GN63 t7yNEin/cJDoX1mIshncdyt3pMWqdA9/I3h7W5uB0fd2cKLNwh+0gusPhuufot+meGlS woNRB7JlEC/T+dsEjr7t2QC3mV+nBiRGy8K8ytUshV+fPplvi2uLM1xh/mlxh06gHUbr wyGIeFCLRqukb4PIPGsM7mVuHgflabctI3cJIu2CX++P4BXOTZzR9xxbSbe2vfrAFpoP c8+Asl3HnPyWLSKDAuCpAO/65bad4iLUqBmWGHjtiO4Ie6jeCD0Lkf5WDMAmMUg9ZI+K VyCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd18-20020a1709069b9200b0072b35a39f7esi251605ejc.1002.2022.07.08.18.33.13; Fri, 08 Jul 2022 18:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbiGIBB3 (ORCPT + 99 others); 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: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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