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: 5509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2388:b0:96:219d:e725 with SMTP id i8csp548166dyf; Thu, 16 Feb 2023 06:13:40 -0800 (PST) X-Google-Smtp-Source: AK7set90RnXeqTdT3g2k97Qm3goQoZ33LmpVT28IEXmeRqRwSrZ8rnH0NmDexwA+h+b9RYb1zylw X-Received: by 2002:a62:1dce:0:b0:5a8:bbde:a074 with SMTP id d197-20020a621dce000000b005a8bbdea074mr4958964pfd.12.1676556820250; Thu, 16 Feb 2023 06:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676556820; cv=none; d=google.com; s=arc-20160816; b=Md2NWPN92c1xusRzElfzgPTQ7mTvB8dEZZBDhvV+wx40j1ngRXoxxLd7jqpasgyALH 4U8RkRBQlIxogtOeAC7MmZfU3PwuED7KIhZtaFFO5Up8cii8dJRkXp3HQX/ccc5bDHY1 AW0EFLk1Mqp9Q0lduujPfwCrjq+eOvFaeOWqatGkGJdikl6e6PHC0K+8iCqh8r5qvKLI ZmzWKfdwz3tPCTG7BbZBUACbf5ihXFiViI52YCwLqjaD9wSICnvYgusTtgcv2ZaWRjrf 2AbdMT/eCukgW5vTX8VthZkDf3Mpi0JuV1hJRV+JA3xb1Y0BFXAJ5dQNFkYV9zNTv/Or znUg== 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=VqkC3M50c9nK1Ejo60ISbwmzwv+JE147t5PTIpGFBUk=; b=Y/LLq7VeXJnDvxNSQ7sdv+8PONiqwbPVOAi3gneFw+dcJFldJAFMbnQRLJZftM9x0y UCiLxeiGDdyvj5DXmzIM6wN/fdVHf/rgcctcUODXQfL11DBEvhclPAfrV/xBh+zqzJ5o hekcrss251YKT8n6wIz+8t3O03yEeVcmdjlxNDoDvbLjzKfD/orgGwbAFJWjJt/Hqld1 JlblOuf097St5lR/j10SZu1bCx+muWmNs5YyHnIzwG0z93FOwaUssO9hFPph/Jds8VEs Mih8cGS70I41Eh1ers4W/IErhhh/Kk7BgwJ8B4D7Q9UtqQh+j1f6d0plZi30max97nMV nMbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z26-20020aa79e5a000000b005a8b55f540bsi1549164pfq.268.2023.02.16.06.13.27; Thu, 16 Feb 2023 06:13:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjBPOMu (ORCPT + 99 others); Thu, 16 Feb 2023 09:12:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbjBPOMr (ORCPT ); Thu, 16 Feb 2023 09:12:47 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A841E3B86E for ; Thu, 16 Feb 2023 06:12:45 -0800 (PST) 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757997244320549422?= X-GMAIL-MSGID: =?utf-8?q?1757997244320549422?= 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(-)