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 4E352E7717D for ; Wed, 11 Dec 2024 16:54:13 +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-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Subject:Cc:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9ENaZwlsqB+Nn2mcWXrWJvuAW28g1Tg8yq3i0uLFNLo=; b=lmhq3J0OembiOZk0IG7mID8N9v PkoidNddPRXd0Z7kV/yeKg9YwiS8DgAOEU3u7uwTQih1g8WY5Q7GeTeSh93/NcM8QFxnU1atvBN+X UikPBSBAg5mtAIz3vYxDbThWQsXG1X5wQpReabzPT0LyZXMKA2cjCTDNWFphI3FR8lukz4hiMDMqX mwa+sC0RLLPqE8gnlUDZxqxftausu9CyiNhRE+U8oyE6WhAE/sdeCMr9h/fOBeCWz7HV/srHwqmNL m2DacVNcHpTp/qUyewswKjXPhHOS4PuYlQNRHI32BRLUrs/n3Tl9kOf2vkz9lXt+9kFyoxGdpq+g7 8iIDZgpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLPyI-0000000FWv8-3esC; Wed, 11 Dec 2024 16:53:58 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLPxF-0000000FWmQ-2rHL for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2024 16:52:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A3D3FA40858; Wed, 11 Dec 2024 16:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6803C4CED2; Wed, 11 Dec 2024 16:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733935972; bh=wAVbop7TdJ/MDscbnuJebtK0QRx/SGfR8noM2AUSjwg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HRnyGKFv7ltn2J5aIhUJipuG0pg5Xueu22dXzWyFOnN2tQ732FxaF7ygku45scGxn iFNJrYh9jyW7yoQRyhCkqhrmTaDDf9jdQKO5oz9968s64iR6d7tGCWTkMEfx6MmY10 mYtSNJgWLhDOcWI7TxEXiLkHiljPPfxfJfxxwBP7fLNmQ5eKU6MIuIZHfqZPSFS7Sx 3Fqz/9muX/I1V4HXxsx4Guk4qbdZXpc0r/xdZ9W9PBAQ9Pfg4xq+jBFmi/Vj9WxhT7 WoeT3b1ixMXh0tD3bVaBR83r6QEt5inQW3xfrA60MzVto6SlfnN3xJIRDS1SLR+J8b R93LpRdcl8jjQ== 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 1tLPxC-002kk5-A3; Wed, 11 Dec 2024 16:52:50 +0000 Date: Wed, 11 Dec 2024 16:52:49 +0000 Message-ID: <86pllyrwke.wl-maz@kernel.org> From: Marc Zyngier To: =?UTF-8?B?TWlrb8WCYWo=?= Lenczewski Cc: catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, liunx-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@vger.kernel.org Subject: Re: [RFC PATCH v1 3/5] arm64: Add errata and workarounds for systems with broken BBML2 In-Reply-To: <20241211154611.40395-4-miko.lenczewski@arm.com> References: <20241211154611.40395-1-miko.lenczewski@arm.com> <20241211154611.40395-4-miko.lenczewski@arm.com> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: miko.lenczewski@arm.com, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, liunx-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@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-20241211_085253_841864_69F41631 X-CRM114-Status: GOOD ( 26.21 ) 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 Wed, 11 Dec 2024 15:45:04 +0000, Miko=C5=82aj Lenczewski wrote: >=20 > There are systems which claim support for BBML2, but whose > implementation of this support is broken. Add a Kconfig erratum for each > of these systems, and a cpufeature workaround that forces the supported > BBM level on these systems to 0. >=20 > Signed-off-by: Miko=C5=82aj Lenczewski > --- > Documentation/arch/arm64/silicon-errata.rst | 32 ++++ > arch/arm64/Kconfig | 164 ++++++++++++++++++++ > arch/arm64/kernel/cpufeature.c | 32 +++- > 3 files changed, 227 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 100570a048c5..9ef8418e8410 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -1127,6 +1127,170 @@ config ARM64_ERRATUM_3194386 > =20 > If unsure, say Y. > =20 > +config ARM64_WORKAROUND_BROKEN_BBML2_SUPPORT > + bool > + > +config ARM64_ERRATUM_3696250 > + bool "Neoverse-N2: workaround for broken BBM level 2 support" > + default y > + select ARM64_WORKAROUND_BROKEN_BBML2_SUPPORT > + help > + Affected Neoverse-N2 cores (r0p0, r0p1, r0p2, r0p3) declare So you list a number of affected revisions... [...] > +static bool has_bbml2(const struct arm64_cpu_capabilities *entry, > + int scope) > +{ > + if (IS_ENABLED(CONFIG_ARM64_WORKAROUND_BROKEN_BBML2_SUPPORT)) { > + static const struct midr_range broken_bbml2_list[] =3D { > + MIDR_ALL_VERSIONS(MIDR_CORTEX_A76), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_A77), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_A710), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_X1), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_X2), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_X3), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_X4), > + MIDR_ALL_VERSIONS(MIDR_CORTEX_X925), > + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1), > + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), > + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1), > + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2), > + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3), > + {} ... and yet you flag all versions as broken? So which one is it? If it is really the case that all versions are broken, then the text should be simplified. Otherwise, this should really list the broken versions. The other thing is that I find it incredibly dangerous to rely on some config option to disable a feature that will absolutely eat your data if it is broken. I'd rather see the whole BBM-L2 being behind an option, and unconditionally check for b0rken CPUs. Specially when it looks like there isn't a single CPU on the planet that implemented the feature correctly... :-/ Thanks, M. --=20 Without deviation from the norm, progress is not possible.