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 14226C4332F for ; Fri, 3 Nov 2023 11:38:08 +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=twtvlalSn4Bl68skXl6ytpRJCkYs3G5PMWJ5z7Z/PFc=; b=gpcB3AA2/iyDr6 dcK4rRllaxZj3p8Sop7S1PrW6fWrOTQn5zC0yIKMpOwcJ2b97eEf3ImzdrIZ5gy//LCVCNxGrTg8E 6NZr7cFspG2hJgdPYRzdMGQHqckJ1RV+igZgtQN2Wlh33/zvLmIge8WRlkUy2p6SzyloQkzu6iTZI WzQyeenyb8ng9g3U7JeLFSetOTQcW2ALIWrRgj4XCShhdcqVWawYNmwOt1Ll6ICEcdJw6Y23HBbNn r9zDDDVXRQ4xFbXrYiHXjg0KNpuOS355OuTSp/SwZFzJPA5HVi8ZENSxIuB43BopwcdubgxYxSNOa CNFylQjKiS8LlmPo9Agw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qysUY-00BLIH-1v; Fri, 03 Nov 2023 11:37:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qysUV-00BLGx-0m for linux-arm-kernel@lists.infradead.org; Fri, 03 Nov 2023 11:37:32 +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 1EADDC15; Fri, 3 Nov 2023 04:38:11 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.37.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14DC53F703; Fri, 3 Nov 2023 04:37:26 -0700 (PDT) Date: Fri, 3 Nov 2023 11:37:21 +0000 From: Mark Rutland To: Ilkka Koskinen , Will Deacon Cc: Besar Wicaksono , Suzuki K Poulose , Robin Murphy , Raag Jadav , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: arm_cspmu: Reject events meant for other PMUs Message-ID: References: <20231103001654.35565-1-ilkka@os.amperecomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231103001654.35565-1-ilkka@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231103_043731_330251_854F4258 X-CRM114-Status: GOOD ( 17.53 ) 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 Thu, Nov 02, 2023 at 05:16:54PM -0700, Ilkka Koskinen wrote: > 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 Acked-by: Mark Rutland Will, are you happy to pick this up? Mark. > --- > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 465ECC4332F for ; Fri, 3 Nov 2023 11:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233433AbjKCLhc (ORCPT ); Fri, 3 Nov 2023 07:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233073AbjKCLhb (ORCPT ); Fri, 3 Nov 2023 07:37:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A330C134 for ; Fri, 3 Nov 2023 04:37:28 -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 1EADDC15; Fri, 3 Nov 2023 04:38:11 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.37.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14DC53F703; Fri, 3 Nov 2023 04:37:26 -0700 (PDT) Date: Fri, 3 Nov 2023 11:37:21 +0000 From: Mark Rutland To: Ilkka Koskinen , Will Deacon Cc: Besar Wicaksono , Suzuki K Poulose , Robin Murphy , Raag Jadav , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: arm_cspmu: Reject events meant for other PMUs Message-ID: References: <20231103001654.35565-1-ilkka@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103001654.35565-1-ilkka@os.amperecomputing.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2023 at 05:16:54PM -0700, Ilkka Koskinen wrote: > 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 Acked-by: Mark Rutland Will, are you happy to pick this up? Mark. > --- > 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 >