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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C946FCDB482 for ; Thu, 12 Oct 2023 09:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FbI433FD04qpdEGj4MJJxr1bT/7Fss0200jGXa5qKA8=; b=OluHQiAwgphMXP 63qsMaEi7zakZmamhTNIxKWC2oo/3z0pQbx16/FnRJrGUWndQ+/0ws/QOdM+S1MwBYJZJmoo/Sxra zwYsQx9Wm3iKb9exE4fdwm0nhfZrqzpwrM8Y9bQaBu1XIiyt/GI/11Htf+FsCPBRouOhiSM8Wnp5a Scnu1L0uVfSiNtRY1a2jnofJiGKw9wDf66fBlfsr+zB43M0FvVfpFP1mYBaZgnfHNd4to2hvYvIvR zVdXWkvBeXhi5nbJVH+meRjH3taBI04qMhTWuc0wuBXMWys6RFpZIi4jqtDS9akO/+ku7u8FLu0T9 trp760YUQcI+WDagvCHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqre3-000JlZ-0F; Thu, 12 Oct 2023 09:06:15 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqrdz-000Jk9-2a for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 09:06:13 +0000 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-Disposition: inline In-Reply-To: <20231009043724.175100-1-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_020611_913861_F91DFB95 X-CRM114-Status: GOOD ( 19.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel