Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1682534rdb; Sun, 8 Oct 2023 21:38:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGW2umkzgwlde4BPgtVUsT9q6mxRu3NrVQ+uRNeSFafE0BEaMSf4hTkc37tFR06kigkZrHT X-Received: by 2002:a9d:6e02:0:b0:6bc:6389:b07 with SMTP id e2-20020a9d6e02000000b006bc63890b07mr15398176otr.23.1696826285671; Sun, 08 Oct 2023 21:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696826285; cv=none; d=google.com; s=arc-20160816; b=aZ6nA2oAzWndYjtj6iK2z8Uf1PZpX/jI9tn+jnUnIIsnRDBoo+o13d54Iv0XU7WnJy HG3ZhbqnkvCN0lr5DZK4e13vTEQqf3ZjddhykcMWNQnUllmICZebbsfNDXiwy1bVNvI3 rvDQwfIKrNb1i5Y+CP7QkRe5KJVGadQDX7MZRkMo3VeV2Zprx81ZWXnaBIBKXJO8jfis T7KuvdRpZVSFCHXjtkpxG2bOePMbX9PDSymvs5gE9l0H3s0xc5sJaA/jD44UkMOYRFLO QHaf/ruQN15pVQXe919P4fsKHWsNQNdJHZHlgXsa0+U+a42pycebayaSfHgx9Reb9h1O eHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MBzp0b17h2YJZF1VbcMEs2cG0JAa3o+9a9yuVlxdz1k=; fh=s03SIMIeJHh4tNM3mw7pRMBjGeQiA04Y7AfUJ3pCpAI=; b=mLkVJrRgqn5eZGIoBc6XRK3QYY9mTmAaEZZNv4NK13Dvvcwf4QhG8MzVj1xYUndSG1 L723G5pMbW3zUpW9B705fWZCj3rnbs+3u8TN5CA8JpxwL6YbisfjCfTLCTraeUA7PUe+ eCq6er9mdo+JKVAOqsdwYOvLqK8ieFXF/Ijav61cV5mZVqOQ8TVqykwddKlXbyxTc8Nb fCeMpYepis+rBi71d1ggw32G/d0URUP155H4N7W+4j6MeRnygn2go9wiu0M8dXRlexsL 6Q+H8xXlrBAsLzYhbHD4AZh+fv1ro2A/MoCPd35kSu4EZLRwVE16FcVLVgb8zyUh5Iqy RlYQ== 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:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q8-20020a63cc48000000b0057e0c5a34f2si8807393pgi.631.2023.10.08.21.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 21:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 7712F8022446; Sun, 8 Oct 2023 21:38:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345066AbjJIEhh (ORCPT + 99 others); Mon, 9 Oct 2023 00:37:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345055AbjJIEhh (ORCPT ); Mon, 9 Oct 2023 00:37:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD548A4 for ; Sun, 8 Oct 2023 21:37:35 -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 1F8631FB; Sun, 8 Oct 2023 21:38:16 -0700 (PDT) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.41.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AC24D3F7A6; Sun, 8 Oct 2023 21:37:33 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Will Deacon , Mark Rutland , linux-kernel@vger.kernel.org Subject: [PATCH] drivers: perf: arm_pmuv3: Update 'pmc_width' based on actual HW event width Date: Mon, 9 Oct 2023 10:07:24 +0530 Message-Id: <20231009043724.175100-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Sun, 08 Oct 2023 21:38:03 -0700 (PDT) X-Spam-Level: ** 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; else userpg->pmc_width = 32; } -- 2.25.1