Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp153976rdf; Thu, 2 Nov 2023 17:17:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFstP/97aozUesKGOf5BJ6U/1eYBY+9c54j7EWtYEFLx+78XgNYhTdU7qsiM66TfgatK+/G X-Received: by 2002:a05:6a00:1741:b0:6c3:41fd:3a3e with SMTP id j1-20020a056a00174100b006c341fd3a3emr2728374pfc.27.1698970660902; Thu, 02 Nov 2023 17:17:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698970660; cv=pass; d=google.com; s=arc-20160816; b=PvlNR3bm92G6iv5cuzn4bnDa0+2NBPP1qz0U7o8VzvU8bSg5soDocqCAv4GRbXyRk4 wr2IiuQl6f5k0pDIPvN/lb+J67nOflB3On3/xdoCpBIV6NoN1V94i5FE93z3HWa2s0Vr yG4xekiWOa04BKXOT1IrJtgKRFpwQytNu9jLhR1gf657DmJJug3ds5yzTdfY/l+abyoM K/1ks5tDWH8CcBL6b2wSDsiT3gFYySZyqho9ju3ZU0bNSm7Cywyt+9YnCpkcOpZDXDq6 AH7kQyM6OFbmGQClRBaK2jl0UruNoNOQvvZkBOR7WnZgFOGDREctXkfdwsA5PaHH4nUk wvEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=GGketpKI5rmxKh18ibSP1FRO9u2E+nT9JpG8FKhYiYM=; fh=arWQeR5RfbnWmJiENbxdlPrDM9tRS+UDLnlP62rJanE=; b=kwEOhqNECr57S0txsybw/arOwKkBSFqRfS/Yi8ZY8wekXFJQZ5paBR+Dj9kokiqa+X vSxQboL5gwhfRdwtSU3chOHW7kbS1O0ClidZTkpNNHMR/532JVIcNkMqtXX2YFAL3MjK ZQPKgOcC9CS5FCndqwVUs6jvGSVvQEqye3Ccm9rEzx7Zcg7tpqEP++Ad2eUliJrZB1KL OcRQWILjHXjW5McIZboLjVJP+ris4pbK3m1mKImFJ4BSQk1IfSqd7edR1ItfaUS+eo9l ZGfSgjsCgbI8Gux3sFu7upzplD3aIsJHS/eQOiBptsyN1yFiG/bnwg/6IZED/lePZWZr jmLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=C053Ac7Z; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cl20-20020a056a02099400b005b975375d70si537304pgb.331.2023.11.02.17.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 17:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=C053Ac7Z; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D67CB82CC432; Thu, 2 Nov 2023 17:17:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231907AbjKCAR0 (ORCPT + 99 others); Thu, 2 Nov 2023 20:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjKCARY (ORCPT ); Thu, 2 Nov 2023 20:17:24 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2119.outbound.protection.outlook.com [40.107.93.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D8A4136 for ; Thu, 2 Nov 2023 17:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KJ1AT0CNWg5AkGdjOnRQ+A2L+t3XwGAulrOkTzD/zqwRhQlyLBVVctnH6KLszaXO/gixo4lOB0mM1J082Hl/JyiKvQ1M8JVKmKHVGgCsw3J/ZLiJmpjmIBo7Z0ccK8gkBIjlo9OZhEL4ZHho0e059DksLlQ0KkpktD012sSIsjw92A9IywwAs4dyKOALsNW2gr1Aap7uPtX7yIU64/9TYb4D99sWduDxiVEts1Z5IiZqH4A1Vt91jzA3xHeKUShOqJMSnGHf60drWF8FnDHwlL7jdOLwOfAYn0Uk9fnDkm1qcpURK+EQX0BpAUuZkJ3kpKzi5NhRXZvZp/0+FYtSFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GGketpKI5rmxKh18ibSP1FRO9u2E+nT9JpG8FKhYiYM=; b=BDDMfK2oG/G6JiGC3tcNP8LjPyyyKIg87WZD61fEvR0i53en7OFzuLB6+BH2SgSuduwIAsVilcZ3Dy1Lfx1aDegDpMgp1nDFB/WZX/RkuMjwbZiokR2M4AwoPvkHLcp2JVQV3HIdY8uSrHWfcPDiODEiXdyrz10bJRFFvHHQyizgVOlVtUDT5dskNOxzWOZqo5MnD031vhnr1Ln7FXIVMC1IeCl5ZXbqfYkuCYA7X/oCWRt4Ilx1jB5WAX5zBt55OzoDhSn4RjZgYzME3YPiew3dAVSqhXxc7ua7/AxxkoVg6kCt7T0l8b0Q974XzBeHayOwdPKoxVp7XmMw2nYWNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GGketpKI5rmxKh18ibSP1FRO9u2E+nT9JpG8FKhYiYM=; b=C053Ac7ZCKG+K6TP2lJZwF4RSiFUruTI60X0lnZvk1JH9Lbmr5RvaetJeG6cNERgHriQE5rEhuxj2GdVwZ12Vy0lDrXDN8zcFxa04bZMXq8o9Fi/HxSpqSuoLmDcdZ35D7wDWzE+RrOGk070aYK2d5joiLwU5ETCSoIvGrIMnXE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) by DM8PR01MB6808.prod.exchangelabs.com (2603:10b6:8:23::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Fri, 3 Nov 2023 00:17:15 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::f7a2:1a96:ba3f:d70f]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::f7a2:1a96:ba3f:d70f%4]) with mapi id 15.20.6933.024; Fri, 3 Nov 2023 00:17:13 +0000 From: Ilkka Koskinen To: Besar Wicaksono , Suzuki K Poulose , Robin Murphy , Will Deacon , Mark Rutland , Raag Jadav , Ilkka Koskinen Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf: arm_cspmu: Reject events meant for other PMUs Date: Thu, 2 Nov 2023 17:16:54 -0700 Message-Id: <20231103001654.35565-1-ilkka@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: CH0P223CA0020.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:116::10) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3590:EE_|DM8PR01MB6808:EE_ X-MS-Office365-Filtering-Correlation-Id: 8dd68dfc-19c3-4da4-d1b8-08dbdc023a36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pObBRVra+uSdYbZUa7qJGSRBYqK9DzUAKbwSnueQ5IxA9QOPF7gnTa42E1khwfxdTAXaXLqSHur13m0R4+jPKAxXs3cqNSg7/dveJLVLVkTLAsASirUBFGccFS4vl1sHNSGJ03AXX/uWeKOaIjNiaqelYJVkM5H8XcvCZrIL0dGJlC6I7tn5fVm/hR/mD4IVtery1B+4Kx4F4MH+C8of5/B8DSmOAXLBOqkz7uyflfytd8xGFAvRDYzREK388jkhTpPaYwoLMZrd2HbDCHV+uZKaIvaGPQ+5HMYc4gsSp21dTF16U8mUpGaiDbpKBn3sN7Bxal53snm47ZIbeq3JYgiqMi0ldEEdVO1s5mabxTQOnW2dp+lv9mg/m7fSK3E6nhXl+pUw4mE/9ed/TCWQYFdfRK6NV7URdsY8aYtHI6MGg66RnC3yghzucJej+CopOJe72u4gSGnMYVzJIolDqx72G9WrwtSUQ+Yf53Jxe87fsTDKa1fgSfFsFLbHMePaiLKSOdHagsROc9hdHvEKMLEuWWHl9+9lXNMJQ1X27WD/RclPh2dhphr9nt3/7uIKFjTxF8hXXvLtphegtEb3jJwJHa6f0oXprl4XQ2tRiuSty1cqsBCGI6FHAkr8h3oB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3590.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(39850400004)(376002)(396003)(346002)(136003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(66899024)(2906002)(6486002)(478600001)(1076003)(2616005)(26005)(41300700001)(38350700005)(38100700002)(86362001)(52116002)(6506007)(6666004)(6512007)(66476007)(66556008)(66946007)(110136005)(316002)(5660300002)(8676002)(8936002)(4326008)(7049001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Y0RaV71QYrTF7bXjBEVJjnTnZwEzefkDkfp1RKpRzcj13J3bI7CymU4kB73q?= =?us-ascii?Q?w6smKVv1TPFC+eM5iuF2qHR/20oOSvx+GPWfLlshWVdK3TTXb9Df04B4Pfo9?= =?us-ascii?Q?GAfuH/lXPdBQnJrAmdG3qcWuM/P+7XRtDdEvpfMIGNPbpA7kRg9YVeZLkBdY?= =?us-ascii?Q?C1Afg/VJZFVPefWX6W7XCeKNGvwPwbX1Tb0gbTSPGBzShcaRjtwaHJcM+uRS?= =?us-ascii?Q?e+t2HIe0kPi4+x8Oc6gNuT9NwChcRx3JBc9jT1WkT0zODKebmoyzIxWFn+Pc?= =?us-ascii?Q?h3Lamb8wZkWeb/+jgiSeoTCiE0Cq3mXXlHEgcck/CVIxEKLsDjK6vxHmm1cK?= =?us-ascii?Q?tIuoCZVazTz23eQ9659jOOvwL5n01o65D5DleYSstfM2aIP6gT36RufEJ+ld?= =?us-ascii?Q?FU3SfO5beVeJHLE3F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?us-ascii?Q?TdrixyPTbGRzX33CzZKcVYTNU7314jH+IgPezpHQH1r56xXpnEtMbdINYM85?= =?us-ascii?Q?UwuHbZGQ59rsW6owLyd8h6i/H7aWzQ04LWjB8rhEI/znLwE/DzbVk6WbxYsZ?= =?us-ascii?Q?QH1d/arfiD0pg34ZBOuIjpJ6LEidgkGKLofsLjEk6h73e9g6foVxtdpp+jxO?= =?us-ascii?Q?JlFksW+DdWyaK4FCLSaNmF51OuMWThKiD1dKQEJ/jrMAIwVZs3CEnzmy5AuK?= =?us-ascii?Q?oDl1cBSzdjnfQzzq7JlbCa6oLwP11H/gYbudsclV2qqgwPRfwKcMpeg3LYPR?= =?us-ascii?Q?EK/v3JDtk4PGT+VkCVSK3lg=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8dd68dfc-19c3-4da4-d1b8-08dbdc023a36 X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 00:17:13.3763 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5cAlY/byVRFSVs6Pay3vWFR53uX7cXB20GjvS9r7w/q8Bp/mA897Cq5/9pshsi1gS14H9NoAt/K1qovniAQUj47yUGhaneiM81+IoSGe3qL18PkomIZfpR/gtV2zUEck X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB6808 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 17:17:40 -0700 (PDT) Coresight PMU driver didn't reject events meant for other PMUs. This caused some of the Core PMU events disappearing from the output of "perf list". In addition, trying to run e.g. $ perf stat -e r2 sleep 1 made Coresight PMU driver to handle the event instead of letting Core PMU driver to deal with it. Cc: stable@vger.kernel.org Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") Signed-off-by: Ilkka Koskinen --- drivers/perf/arm_cspmu/arm_cspmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c index 42b72042f6b3..2cc35dded007 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -676,6 +676,9 @@ static int arm_cspmu_event_init(struct perf_event *event) cspmu = to_arm_cspmu(event->pmu); + if (event->attr.type != event->pmu->type) + return -ENOENT; + /* * Following other "uncore" PMUs, we do not support sampling mode or * attach to a task (per-process mode). -- 2.40.1