Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp171409rdg; Thu, 12 Oct 2023 02:06:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb3QWAz7MDfI9xYOI41JnYRy1nJvDxo3qhMc5Qu8ggaTiz6ZF5ZbTKCXmrp7RRRxe09JpN X-Received: by 2002:a25:c74f:0:b0:d9a:3c82:54b7 with SMTP id w76-20020a25c74f000000b00d9a3c8254b7mr9217100ybe.59.1697101595420; Thu, 12 Oct 2023 02:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697101595; cv=none; d=google.com; s=arc-20160816; b=cnI/GlM9LeKtkT9El5Cu26/uNnnAqiWZBAicVE8actIRnJiCcXbptUnnB6YW0r+F+T GmtThaXNl/XdMoLfYXiZwR4iKJTfWZMW/ms8+PJK9TD/6qLMnHMfmwF7H2XxhIe/VmaZ eWrbKKWVNbZ6dK2T9IsNmFtOn4IpAj7A2sOnVfzqJdCjNKgJuaZeNourwYJDyGMpnf/k xrfI53bV7Guw8f1OEPgjRnob7wD2tQjGegJiR5YQB7zBWl5kOWC8RvGPioRxJnWQkTWz 4ugTJevWX7o/bsgMmZoqUHNiGDXuTwFNPYKgWNyMRzmtPaavnBqlONfyKpWWYf+/jO+V 66Nw== 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=7/U6KUW/Vuhx7FVgSY55m31bGjHKAiZHbFHsE5nEN44=; fh=v12IkMS+WPIsN3ut50ZPWuUQeaP+BA0dQeKOQe5Jo1Q=; b=RPoiGVvWLCYGepn4p/wL9dQg2cHcyIUUnTL2C3dXjcqSEasqYDZByOurkvEaH/rKNp sbKUG8NZFbuv7jchwuAQfExukEqXIR5WCRGR5oA6JT5P5Pfyfa/XiRxDt9LT4TfC8tN5 sZIR5pIBVecr6Rv2NIeo4f2W6gihWX25tRyJAcqKMmAKuFcXBli6qSva9O80VFPwAio4 netunmf45lHQ1A14OwrCShheckC9UUBl8Lhss/cUoaVlirnAl2kr4zSNtelMNrX1TUr4 KGjqVyqHtttDNDgLv37o+iBxQLGrDglJ+Fh8kSwGvcoCHmxHzxPUI7UugAXvKvj7BILl 8kVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v15-20020a63480f000000b00573f93787e4si1775823pga.103.2023.10.12.02.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 02:06:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D6BCA810AF55; Thu, 12 Oct 2023 02:06:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235407AbjJLJF5 (ORCPT + 99 others); Thu, 12 Oct 2023 05:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235440AbjJLJF4 (ORCPT ); Thu, 12 Oct 2023 05:05:56 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 79762D7 for ; Thu, 12 Oct 2023 02:05:54 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DC5213D5; Thu, 12 Oct 2023 02:06:34 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.81.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0AF8C3F762; Thu, 12 Oct 2023 02:05:52 -0700 (PDT) Date: Thu, 12 Oct 2023 10:05:50 +0100 From: Mark Rutland To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: perf: arm_pmuv3: Update 'pmc_width' based on actual HW event width Message-ID: References: <20231009043724.175100-1-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231009043724.175100-1-anshuman.khandual@arm.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 02:06:21 -0700 (PDT) On Mon, Oct 09, 2023 at 10:07:24AM +0530, Anshuman Khandual wrote: > This updates 'perf_event_mmap_page->pmc_width' based on actual HW event's > width that are currently missing i.e ARMPMU_EVT_63BIT and ARMPMU_EVT_47BIT. > > Cc: Will Deacon > Cc: Mark Rutland > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > This applies on v6.6-rc5. > > drivers/perf/arm_pmuv3.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c > index fe4db1831662..94723d00548e 100644 > --- a/drivers/perf/arm_pmuv3.c > +++ b/drivers/perf/arm_pmuv3.c > @@ -1375,6 +1375,10 @@ void arch_perf_update_userpage(struct perf_event *event, > if (userpg->cap_user_rdpmc) { > if (event->hw.flags & ARMPMU_EVT_64BIT) > userpg->pmc_width = 64; > + else if (event->hw.flags & ARMPMU_EVT_63BIT) > + userpg->pmc_width = 63; > + else if (event->hw.flags & ARMPMU_EVT_47BIT) > + userpg->pmc_width = 47; The PMUv3 driver *never* uses 63-bit or 47-bit counters, so the PMUv3 driver doesn't need this. The ARMPMU_EVT_63BIT and ARMPMU_EVT_47BIT flags are only used by the Apple PMU driver, which doesn't support user access, and similarly doesn't need to handle this. This code is not necessary as the two new branches can never run. It will also confuse people into thinking the PMUv3 driver can use these widths when it cannot. NAK to this patch for the reasons above. Mark > else > userpg->pmc_width = 32; > } > -- > 2.25.1 >