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 24A1CE77180 for ; Mon, 16 Dec 2024 15:29:49 +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=AdGL/Tz3xurrRoLzcPoxAPl+bc6OdESuPj65271AowM=; b=2DEJZmmF65elHaN09nsHatuyv0 vBZT9+IpWo2d0fFPZxD/aaufVsyMws4xNA9bux3MdvqKwRXrmB/mcjVOqH2L2GWS28YlKEUd7aedN 543cWwvCoWER2XxrxRpOTa6UFhFzUs43LG+SByzCBzL/jtoEwGqhn4kAzVFKwbCT/o0+8EhH3AD+M 4jH1q9XxAA95x8yau33u16xfxbZ4puKvj9XsnBamMm3eQ+Yq3Y2otiy/ScNkSVaj8gOA3uIQUaBe7 HRy5o4769UrdrrA07jP06p75NR2WzrAV4uqcMWww9UYTupKivJgfWBXxIiQyGwbwvmP33aPZPRaFH S/nRGBSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tND2O-0000000APXM-1CUx; Mon, 16 Dec 2024 15:29:36 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tND1I-0000000APSE-3Mdi for linux-arm-kernel@lists.infradead.org; Mon, 16 Dec 2024 15:28:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1747A5C61F5; Mon, 16 Dec 2024 15:27:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E699AC4CED0; Mon, 16 Dec 2024 15:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734362908; bh=IbsaaHxncXLMIVV4lJHHEMhHUJMHu9Y+Jmy4PIDzRz4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LlwThIKjhLawfVwAbbGwpbaPFHItPOwAP4RqMDS/gLnvUEf2UqemRUVCbdYA0VptC CnCVPKvrlgRZzW9dZ8yAH8i8ucxO05s9OqNGbjH9j23UXJFQt7ykL6crXz0UaPKWNo yHQvNe14PFgBbMNify7hFQMow1QxN47behDRyzQ77Aasny5wn1UBmFl1Ut1KNO63lx eeiIpmy6vvjHSESD4ggZujLqQCGa/QzI0sj1ujw5ntWeKYpFGH7xQlo3DI9TbPwt+h KtsL8snCYo3baV+VNgWmJlRCQAJ2xUULAWfHXR/PO5YDnAXthWC9Ll4Ti6AirB/4HY 7wQMznuOX5O+g== 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 1tND1F-004ECw-Pc; Mon, 16 Dec 2024 15:28:25 +0000 Date: Mon, 16 Dec 2024 15:28:25 +0000 Message-ID: <8634insl46.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: Mark Brown , Catalin Marinas , Will Deacon , Peter Collingbourne , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] arm64/sme: Move storage of reg_smidr to __cpuinfo_store_cpu() In-Reply-To: References: <20241214-arm64-fix-boot-cpu-smidr-v1-1-0745c40772dd@kernel.org> <87a5cysfci.wl-maz@kernel.org> <865xnjsnqo.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.4 (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: mark.rutland@arm.com, broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org, pcc@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@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-20241216_072828_926610_3D052651 X-CRM114-Status: GOOD ( 28.32 ) 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 Mon, 16 Dec 2024 15:07:15 +0000, Mark Rutland wrote: > > On Mon, Dec 16, 2024 at 02:31:43PM +0000, Marc Zyngier wrote: > > On Mon, 16 Dec 2024 12:38:17 +0000, > > Mark Rutland wrote: > > > I think that what we did in commit: > > > > > > 892f7237b3ff ("arm64: Delay initialisation of cpuinfo_arm64::reg_{zcr,smcr}") > > > > > > ... introduces an anti-pattern that'd be nice to avoid. That broke the > > > existing split of __cpuinfo_store_cpu() and init_cpu_features(), where > > > the former read the ID regs, and the latter set up the features > > > *without* altering the copy of the ID regs that was read. i.e. > > > init_cpu_features() shouldn't write to its info argument at all. > > > > > > I understand that we have to do something as a bodge for broken FW which > > > traps SME, but I'd much rather we did that within __cpuinfo_store_cpu(). > > > > Honestly, I'd rather revert that patch, together with b3000e2133d8 > > ("arm64: Add the arm64.nosme command line option"). I'm getting tired > > of the FW nonsense, and we are only allowing vendors to ship untested > > crap. > > > > Furthermore, given the state of SME in the kernel, I don't think this > > is makes any difference. So maybe this is the right time to reset > > everything to a sane state. > > Looking again, a revert does look to be the best option. > > We removed reg_zcr and reg_smcr in v6.7 in commits: > > abef0695f9665c3d ("arm64/sve: Remove ZCR pseudo register from cpufeature code") > 391208485c3ad50f ("arm64/sve: Remove SMCR pseudo register from cpufeature code") > > As of those commits, ZCR and SCMR no longer matter to > __cpuinfo_store_cpu(), and only SMIDR_EL1 remains... > > Per ARM DDI 0487 L.a, accesses to SMIDR_EL1 never trap to EL3, so we can > read that safely as long as ID_AA64PFR1_EL1.SME indicates that SME is > implemented. > > Which is to say that if we revert the remaining portion of 892f7237b3ff > and restore the read of SMIDR, that should be good as far back as v6.7, > which sounds good to me. Sounds reasonable indeed. I guess *someone* will want it for the previous kernel versions, but they can have fun with the backport on their own. M. -- Without deviation from the norm, progress is not possible.