linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: "Mikołaj Lenczewski" <miko.lenczewski@arm.com>
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
Date: Wed, 11 Dec 2024 16:52:49 +0000	[thread overview]
Message-ID: <86pllyrwke.wl-maz@kernel.org> (raw)
In-Reply-To: <20241211154611.40395-4-miko.lenczewski@arm.com>

On Wed, 11 Dec 2024 15:45:04 +0000,
Mikołaj Lenczewski <miko.lenczewski@arm.com> wrote:
> 
> 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.
> 
> Signed-off-by: Mikołaj Lenczewski <miko.lenczewski@arm.com>
> ---
>  Documentation/arch/arm64/silicon-errata.rst |  32 ++++
>  arch/arm64/Kconfig                          | 164 ++++++++++++++++++++
>  arch/arm64/kernel/cpufeature.c              |  32 +++-
>  3 files changed, 227 insertions(+), 1 deletion(-)
> 
> 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
>  
>  	  If unsure, say Y.
>  
> +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[] = {
> +			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.

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2024-12-11 16:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 15:45 [RFC PATCH v1 0/5] Initial BBML2 support for contpte_convert() Mikołaj Lenczewski
2024-12-11 15:45 ` [RFC PATCH v1 1/5] arm64: Add TLB Conflict Abort Exception handler to KVM Mikołaj Lenczewski
2024-12-11 15:45 ` [RFC PATCH v1 2/5] arm64: Add BBM Level 2 cpu feature Mikołaj Lenczewski
2024-12-11 21:02   ` Will Deacon
2024-12-13 16:17     ` Mikołaj Lenczewski
2024-12-13 22:34       ` Yang Shi
2024-12-19 16:25         ` Will Deacon
2024-12-11 15:45 ` [RFC PATCH v1 3/5] arm64: Add errata and workarounds for systems with broken BBML2 Mikołaj Lenczewski
2024-12-11 16:52   ` Marc Zyngier [this message]
2024-12-13 16:21     ` Mikołaj Lenczewski
2024-12-11 15:45 ` [RFC PATCH v1 4/5] arm64/mm: Delay tlbi in contpte_convert() under BBML2 Mikołaj Lenczewski
2024-12-11 15:45 ` [RFC PATCH v1 5/5] arm64/mm: Elide " Mikołaj Lenczewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86pllyrwke.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liunx-doc@vger.kernel.org \
    --cc=miko.lenczewski@arm.com \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).