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 BFE52C3064D for ; Tue, 2 Jul 2024 10:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rM8jFyPk5akmJuDF7vKEPyGmplvPwGetBHDNCiVhIU4=; b=U16ZZv/2PVYe3p2hIk6bLSTL5K Z4C4PwyE6Mu4mDEX3fQBxyPZW+xga9BeObcKmY+3pxwzaU1xlesXMBWTmQWL1QkVOog1/GWE/jwzw x1DnNTMjUrtxwsexHbNxWmDdHWZQAGPggn+DmKQcPK1dnbmPmfF57HdHvJJStm5HF4j21V1khRsxv FcHCEDKDASATSv/T1TROBb2pQyP2ghOJ2bEgAPSFtJuy0uju3JIKniIPCFxKlBdjy0AK/GCq5cbZG QT26rHo3yNmCIgz0hLbjZhCGwi9zdSo6XMGvXwODrn9Rfp8oBSW2aTGrhhTUfdd8Z10Orh6tsmBgt tyi6WfMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sObDI-00000006PzQ-1ugJ; Tue, 02 Jul 2024 10:58:20 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sObD6-00000006PvI-3eYv for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 10:58:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C326DCE1DA2; Tue, 2 Jul 2024 10:58:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E209C116B1; Tue, 2 Jul 2024 10:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719917884; bh=rrCVXKvoyxrAjTZibby6tyssNtKkAiDxJiikT8VGUmo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=F6dj6Cdp+pNANzFdsIvbbIfU3A6Z8nyXITbiVxrVehZrbSCOjjDRYh4zOvUT0fIVu 3zvQ03s416MddWLQh86UN7zJ+ewAEeJyCKiVyZxEHRGJquvJsufM6h4n3/yTx6cnyh lKhcInPoJkK8ho9gCNO7OsQJarA+J85DOp8ScDfPkWOTRCFK+bW0oIcR7effym4hbM gwDHyyfxZh9JYkMtfo4CL53bYHn/dEfqYKPNqtz8bpNxj0glfIb+7IG9KLY8vRMyU4 vZBLtbZk6gRjjPp5eG8a+PGt/VC0aiqin1k8QiX/EbZfWpn2pkg1UQeTN0gtLOA0gf 1mSr+JrFSVypQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sObCz-0094im-I8; Tue, 02 Jul 2024 11:58:01 +0100 Date: Tue, 02 Jul 2024 11:58:00 +0100 Message-ID: <8634oshxhj.wl-maz@kernel.org> From: Marc Zyngier To: Yangyu Chen Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, Mark Rutland , Janne Grunau , Hector Martin , Asahi Lina , asahi@lists.linux.dev, Linux Kernel Mailing List Subject: Re: [PATCH v1] drivers/perf: apple_m1: fix affinity table for event 0x96 and 0x9b In-Reply-To: References: <20240701140148.GE2250@willie-the-truck> <87cynxp52o.wl-maz@kernel.org> <87bk3hp3z7.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: cyy@cyyself.name, will@kernel.org, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, j@jannau.net, marcan@marcan.st, lina@asahilina.net, asahi@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_035809_288687_937A15C2 X-CRM114-Status: GOOD ( 24.40 ) 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 On Tue, 02 Jul 2024 11:22:21 +0100, Yangyu Chen wrote: > > > Yangyu, can you please clarify how you came to the conclusion that > > these events didn't count anywhere other than counter 7? > > > > IIRC, I came across some web page that says events 0x96 and 0x9b > can only be installed on counter 7 to count Apple AMX, but I can't > find the page now. Since AMX is not usable in Linux, I don't know > if this will affect some other instructions that are usable in > Linux. As you said, AMX cannot be used with Linux, and that's unlikely to ever change. But when it comes to the standard ARM ISA, we can only witness counters 5,6 and 7 being incremented with at the exact same rate. So reading between the lines, what I understand is that AMX instructions would only have their effects counted in counter 7 for these events, while other instructions would be counted in all 3 counters. By extension, such behaviour could be applied to SME on HW that supports it (wild guess). > There are some other reasons, but I can't say in public. Fair enough, I'm not asking for the disclosure of anything that isn't public (the least I know, the better). > Even though I can't find the actual usage, I think using count 7 > only for these 2 events is safer. If this reason is insufficient, > we can ignore this patch until we find other evidence that this > affinity affects some instructions usable in Linux. I honestly don't mind. The whole thing is a black box, and is more useful as an interrupt generator than an actual PMU, due to the lack of freely available documentation. If the PMU maintainers want to merge this, I won't oppose it. Thanks, M. -- Without deviation from the norm, progress is not possible.