public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Vladimir Murzin <vladimir.murzin@arm•com>
To: Zeng Heng <zengheng@huaweicloud•com>,
	xuwei5@huawei•com, wangyushan12@huawei•com,
	yangyicong@hisilicon•com, maz@kernel•org, yeoreum.yun@arm•com,
	miko.lenczewski@arm•com, james.clark@linaro•org, corbet@lwn•net,
	skhan@linuxfoundation•org, kuninori.morimoto.gx@renesas•com,
	lucaswei@google•com, catalin.marinas@arm•com, broonie@kernel•org,
	lpieralisi@kernel•org, thuth@redhat•com, kevin.brodsky@arm•com,
	tongtiangen@huawei•com, oupton@kernel•org, ryan.roberts@arm•com,
	mark.rutland@arm•com, will@kernel•org, Sascha.Bischoff@arm•com
Cc: linux-arm-kernel@lists•infradead.org, wangkefeng.wang@huawei•com,
	linux-doc@vger•kernel.org, linux-kernel@vger•kernel.org
Subject: Re: [PATCH v3 1/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
Date: Tue, 2 Jun 2026 10:23:38 +0100	[thread overview]
Message-ID: <701c88b1-c172-4fee-ba56-18bbe940016f@arm.com> (raw)
In-Reply-To: <20260601112000.1145391-2-zengheng@huaweicloud.com>

On 6/1/26 12:19, Zeng Heng wrote:
> From: Zeng Heng <zengheng4@huawei•com>
> 
> The NVIDIA Carmel CNP erratum is not the only case requiring CNP to be
> disabled. Abstract this into a common WORKAROUND_DISABLE_CNP capability
> to facilitate adding errata for future chips and reduce duplicate
> checks in has_useable_cnp().
> 
> This serves as a prerequisite for the subsequent Hisilicon erratum
> 162100125.
> 
> Suggested-by: Vladimir Murzin <vladimir.murzin@arm•com>
> Signed-off-by: Zeng Heng <zengheng4@huawei•com>
> ---
>  arch/arm64/Kconfig               | 4 ++++
>  arch/arm64/include/asm/cpucaps.h | 4 ++--
>  arch/arm64/kernel/cpu_errata.c   | 4 ++--
>  arch/arm64/kernel/cpufeature.c   | 2 +-
>  arch/arm64/tools/cpucaps         | 2 +-
>  5 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index fe60738e5943..f297517a83b9 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1315,9 +1315,13 @@ config QCOM_FALKOR_ERRATUM_E1041
> 
>  	  If unsure, say Y.
> 
> +config ARM64_WORKAROUND_DISABLE_CNP
> +	bool
> +
>  config NVIDIA_CARMEL_CNP_ERRATUM
>  	bool "NVIDIA Carmel CNP: CNP on Carmel semantically different than ARM cores"
>  	default y
> +	select ARM64_WORKAROUND_DISABLE_CNP
>  	help
>  	  If CNP is enabled on Carmel cores, non-sharable TLBIs on a core will not
>  	  invalidate shared TLB entries installed by a different core, as it would
> diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
> index d0d3cdd5763c..25c61cda901c 100644
> --- a/arch/arm64/include/asm/cpucaps.h
> +++ b/arch/arm64/include/asm/cpucaps.h
> @@ -58,8 +58,8 @@ cpucap_is_possible(const unsigned int cap)
>  		return IS_ENABLED(CONFIG_ARM64_ERRATUM_2658417);
>  	case ARM64_WORKAROUND_CAVIUM_23154:
>  		return IS_ENABLED(CONFIG_CAVIUM_ERRATUM_23154);
> -	case ARM64_WORKAROUND_NVIDIA_CARMEL_CNP:
> -		return IS_ENABLED(CONFIG_NVIDIA_CARMEL_CNP_ERRATUM);
> +	case ARM64_WORKAROUND_DISABLE_CNP:
> +		return IS_ENABLED(CONFIG_ARM64_WORKAROUND_DISABLE_CNP);
>  	case ARM64_WORKAROUND_REPEAT_TLBI:
>  		return IS_ENABLED(CONFIG_ARM64_WORKAROUND_REPEAT_TLBI);
>  	case ARM64_WORKAROUND_SPECULATIVE_SSBS:
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index 5377e4c2eba2..b0db946568b7 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -801,11 +801,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
>  				  1, 0),
>  	},
>  #endif
> -#ifdef CONFIG_NVIDIA_CARMEL_CNP_ERRATUM
> +#ifdef CONFIG_ARM64_WORKAROUND_DISABLE_CNP
>  	{
>  		/* NVIDIA Carmel */
>  		.desc = "NVIDIA Carmel CNP erratum",
> -		.capability = ARM64_WORKAROUND_NVIDIA_CARMEL_CNP,
> +		.capability = ARM64_WORKAROUND_DISABLE_CNP,
>  		ERRATA_MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
>  	},
>  #endif
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 6d53bb15cf7b..20c5f24f74a9 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1785,7 +1785,7 @@ has_useable_cnp(const struct arm64_cpu_capabilities *entry, int scope)
>  	if (is_kdump_kernel())
>  		return false;
> 
> -	if (cpus_have_cap(ARM64_WORKAROUND_NVIDIA_CARMEL_CNP))
> +	if (cpus_have_cap(ARM64_WORKAROUND_DISABLE_CNP))
>  		return false;
> 
>  	return has_cpuid_feature(entry, scope);
> diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
> index 811c2479e82d..9b85a84f6fd4 100644
> --- a/arch/arm64/tools/cpucaps
> +++ b/arch/arm64/tools/cpucaps
> @@ -120,7 +120,7 @@ WORKAROUND_CAVIUM_TX2_219_PRFM
>  WORKAROUND_CAVIUM_TX2_219_TVM
>  WORKAROUND_CLEAN_CACHE
>  WORKAROUND_DEVICE_LOAD_ACQUIRE
> -WORKAROUND_NVIDIA_CARMEL_CNP
> +WORKAROUND_DISABLE_CNP
>  WORKAROUND_PMUV3_IMPDEF_TRAPS
>  WORKAROUND_QCOM_FALKOR_E1003
>  WORKAROUND_QCOM_ORYON_CNTVOFF
> --
> 2.43.0
> 

FWIW,

Reviewed-by: Vladimir Murzin <vladimir.murzin@arm•com>



  reply	other threads:[~2026-06-02  9:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 11:19 [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability Zeng Heng
2026-06-01 11:19 ` [PATCH v3 1/2] " Zeng Heng
2026-06-02  9:23   ` Vladimir Murzin [this message]
2026-06-01 11:20 ` [PATCH v3 2/2] arm64: kernel: Disable CNP on HiSilicon HIP09 Zeng Heng
2026-06-02  9:24   ` Vladimir Murzin
2026-06-02 15:53   ` Will Deacon
2026-06-03  1:13     ` Zeng Heng
2026-06-02  9:28 ` [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability Vladimir Murzin
2026-06-02 11:54 ` Wei Xu

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=701c88b1-c172-4fee-ba56-18bbe940016f@arm.com \
    --to=vladimir.murzin@arm$(echo .)com \
    --cc=Sascha.Bischoff@arm$(echo .)com \
    --cc=broonie@kernel$(echo .)org \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=corbet@lwn$(echo .)net \
    --cc=james.clark@linaro$(echo .)org \
    --cc=kevin.brodsky@arm$(echo .)com \
    --cc=kuninori.morimoto.gx@renesas$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-doc@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=lpieralisi@kernel$(echo .)org \
    --cc=lucaswei@google$(echo .)com \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=maz@kernel$(echo .)org \
    --cc=miko.lenczewski@arm$(echo .)com \
    --cc=oupton@kernel$(echo .)org \
    --cc=ryan.roberts@arm$(echo .)com \
    --cc=skhan@linuxfoundation$(echo .)org \
    --cc=thuth@redhat$(echo .)com \
    --cc=tongtiangen@huawei$(echo .)com \
    --cc=wangkefeng.wang@huawei$(echo .)com \
    --cc=wangyushan12@huawei$(echo .)com \
    --cc=will@kernel$(echo .)org \
    --cc=xuwei5@huawei$(echo .)com \
    --cc=yangyicong@hisilicon$(echo .)com \
    --cc=yeoreum.yun@arm$(echo .)com \
    --cc=zengheng@huaweicloud$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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