Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1200210rwd; Wed, 31 May 2023 10:40:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77NFIRieV3TlpWWq/fufUnYljvhNfgcOKwIdXmgnbC5XdTYvkNCeaZNPjil6fPW5ZnXImV X-Received: by 2002:a05:6a20:3d89:b0:101:6a2f:2a0e with SMTP id s9-20020a056a203d8900b001016a2f2a0emr6005142pzi.18.1685554852933; Wed, 31 May 2023 10:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685554852; cv=none; d=google.com; s=arc-20160816; b=nnfVTivXP8zsfSzFRDxwa5PuW9EoDSmqNt/WRZJAoFwbqla9RKFJSyb9CPMRxo6Gu3 He+9dojM9CzLB1NUkjRA4Z2QvvaxZY29gNn/mhy5rWRQpopmUrCkpJQ44zKWULw2srh2 C5Aju0UwfG/NvvuSclAbUeVI30Te75cNk63GsK4BYEsvCbDdtVdfUUku0w8mjQVrvXQY vdvczDnGhtdrxJqq9hyWrgk9PV6eptwIr1Vg0X9ll10b2fZWAxHv5ybvqg0EDKx9MY/O 9JY3NyMv/2VqxddQXjbnnvhQCzqFWasLh257QzEtvvhgonEmQPQPUYGgddPZqwTDF/Lf Dgkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CGUR/TbmUq/QOPcnqlHyd2HvHlg6/E2JQhG0B++doWA=; b=rYwtiw+H6Bt9Adc2uSboGTIOPXCj6V8HvopHz3my+/ppz/g/dIB/agsw+4EUzON5Qh LgYD16pnxDo6RRmWTYYBuzd5JD1mFdilYc0UaWjliMwT0+7pvU/NjvC5cOBcQiQXcI8Z 0nuVbpVyvs/QeIRibdYwrmfCgFh2yv4RzKw0zXrzxCGstbt/CbjsPGMtgMfx0BQgooPk V2Wegs+XZ7zF8RvItgSkxVSVAS18NokD+GTQvmd799HRoOIRCNJi1u12PnrTloAcrjws qYdiNdLlr5ZgFqtUW4DFE3em0pKjchB4TzraNgWiqXNdbCPoaNiuUx4OCNLd7vayq/Rs e8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Y6xTF1Sv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv192-20020a632ec9000000b0050fb1a00d3dsi1311903pgb.46.2023.05.31.10.40.37; Wed, 31 May 2023 10:40:52 -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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Y6xTF1Sv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjEaRW2 (ORCPT + 99 others); Wed, 31 May 2023 13:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbjEaRW0 (ORCPT ); Wed, 31 May 2023 13:22:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6100E135; Wed, 31 May 2023 10:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CGUR/TbmUq/QOPcnqlHyd2HvHlg6/E2JQhG0B++doWA=; b=Y6xTF1SvB2B0O/e41dOK0iA2BX yv7/nZXFJbt/tyo/kaRPLaadCaBmC7d2rG1bG9XR1RNHcuDWrZrekzvXJ3dE+R4kU7tj9zHO5jQwl sCg+7dVi0tVXXGpU6Sj75qvFoW6/Px9dSKXMP2fX5gYYV/zYdp3vS6ZIwHPnK6O3WOBHoqPNfcUPa dx9jJji7G4Wfvnfyk8qsCmkhTL1+mszFGZH4jUCiEBDZFsRmkfjfqb1XLlbbTRJVo/vV11jrayncp TuC6JOJaVVsmwX3KggaVFlkOUySIvF4zrxpgK+z3DuK0EXTA++pvHnLZ6n1gRAhf2PS8T14zDZz0v C3BvZJcw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q4PWP-000bpl-15; Wed, 31 May 2023 17:22:05 +0000 Date: Wed, 31 May 2023 10:22:05 -0700 From: Luis Chamberlain To: Maninder Singh Cc: ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, thunder.leizhen@huawei.com, boqun.feng@gmail.com, vincenzopalazzodev@gmail.com, ojeda@kernel.org, jgross@suse.com, brauner@kernel.org, michael.christie@oracle.com, samitolvanen@google.com, glider@google.com, peterz@infradead.org, keescook@chromium.org, stephen.s.brennan@oracle.com, alan.maguire@oracle.com, pmladek@suse.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Onkarnath Subject: Re: [PATCH v2 1/2] bpf: make defination of bpf_dump_raw_ok based on CONFIG_KALLSYMS Message-ID: References: <20230531084745.877337-1-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230531084745.877337-1-maninder1.s@samsung.com> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On Wed, May 31, 2023 at 02:17:44PM +0530, Maninder Singh wrote: > No functional change with this commit. > > As of now bpf_dump_raw_ok() is dependent on kallsyms_show_value(). > Rearranging the code to return false directly in defination of > bpf_dump_raw_ok() based on CONFIG_KALLSYMS. > > @reason: next patch will make kallsyms_show_value() defination > generic and bpf_dump_raw_ok() will return true otherwise. This reads a bit funny and the split here doesn't help the patch reviewier, so you can help with that a bit with the commit log and be a bit clearer to throw in the few pieces of nuggets the reader should be aware of when reviewing your patch right away. So how about instaed: bpf_dump_raw_ok() depends on kallsyms_show_value() and we already have a false definition for the !CONFIG_KALLSYMS case. But we'll soon expand on kallsyms_show_value() and so to make the code easier to follow just provide a direct !CONFIG_KALLSYMS definition for bpf_dump_raw_ok() as well. This makes it easier to read and makes it clear bpf_dump_raw_ok() will immediately return false when !CONFIG_KALLSYMS, making it easier to understand what happens for heavy users such as bfp. With this you can add: Reviewed-by: Luis Chamberlain Luis