From patchwork Thu Feb 16 14:12:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 13143205 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 E5F00C61DA4 for ; Thu, 16 Feb 2023 14:13:50 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JaaBSE6T5x0OdUGd4kIm+LumCBuT4bIxCrNHyw4VthI=; b=WYW1jYdVke66sU Rj/Zdh/UtKTcz/D7Bi8GaXNXoglXrQ/CoJIJnAhHx5KBxMPkaQYuZ/HJTwr+M4ALjngGcjal1DxyO A7satFaJRDwxoNQJWk7GHAJKkt9laSYGaKL/SQnKljAmvRTRZsN9T1SCwuB7rPQODwOdtbC+eODFM txFB0yy8BFMMSFH8qED8J5pO93pyXUpAOk9UjvBPq8VyFSJx9SAEb0rBpGWaTs7dJDr6YsRikWln/ CKWuAfH97xAhHJBaJ7RJqt3Jjz4aigW4Il3KgIG+/X10WqWoCaIP/SW3k2yC4PK3hgKEwYsmI3a5d 9Q3pt1ZuqnFnrTueF5+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSf0G-00AX4D-GX; Thu, 16 Feb 2023 14:12:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSf0C-00AX1h-R7 for linux-arm-kernel@lists.infradead.org; Thu, 16 Feb 2023 14:12:50 +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 249FB1042; Thu, 16 Feb 2023 06:13:28 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0A7143F703; Thu, 16 Feb 2023 06:12:43 -0800 (PST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: asahi@lists.linux.dev, ecurtin@redhat.com, j@jannau.net, lina@asahilina.net, linux-kernel@vger.kernel.org, mark.rutland@arm.com, peterz@infradead.org, ravi.bangoria@amd.com, will@kernel.org Subject: [PATCH 0/2] arm_pmu: fix fallout from context handling rewrite Date: Thu, 16 Feb 2023 14:12:37 +0000 Message-Id: <20230216141240.3833272-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230216_061248_947504_9256901F X-CRM114-Status: UNSURE ( 6.74 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Janne reports [1] that perf has been broken on Apple M1 as of commit: bd27568117664b8b ("perf: Rewrite core context handling") This is due to changes to pmu::filter_match() and arm_pmu::filter_match(), which have been renamed and had their polarity inverted, but the conversion was inconsistent, and so in some cases we return the opposite result relative to what we had intended. This results in consistently losing events on Apple M1. That commit also (silently) removed the filtering of CHAIN events, which is undesireable. These patches fix and simplify the CPU filtering, and replace the CHAIN event filtering with early rejection of CHAIN events, which is much simpler. Thanks, Mark [1] https://lore.kernel.org/asahi/20230215-arm_pmu_m1_regression-v1-1-f5a266577c8d@jannau.net/ Mark Rutland (2): arm_pmu: fix event CPU filtering arm64: perf: reject CHAIN events at creation time arch/arm64/kernel/perf_event.c | 15 ++++++++------- drivers/perf/arm_pmu.c | 8 +------- include/linux/perf/arm_pmu.h | 1 - 3 files changed, 9 insertions(+), 15 deletions(-)