* [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
@ 2026-06-01 11:19 Zeng Heng
2026-06-01 11:19 ` [PATCH v3 1/2] " Zeng Heng
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Zeng Heng @ 2026-06-01 11:19 UTC (permalink / raw)
To: vladimir.murzin, xuwei5, wangyushan12, yangyicong, maz,
yeoreum.yun, miko.lenczewski, james.clark, corbet, skhan,
kuninori.morimoto.gx, lucaswei, catalin.marinas, broonie,
lpieralisi, thuth, kevin.brodsky, tongtiangen, oupton,
ryan.roberts, mark.rutland, will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel
From: Zeng Heng <zengheng4@huawei.com>
v2: https://lore.kernel.org/all/20260529063132.766491-1-zengheng@huaweicloud.com/
v1: https://lore.kernel.org/all/20260526015720.206854-1-zengheng@huaweicloud.com/
Changes in v3:
- Keep CONFIG_ARM64_WORKAROUND_DISABLE_CNP config and generalise
ARM64_WORKAROUND_DISABLE_CNP capability.
Changes in v2:
- Unify CNP disable workaround into ARM64_WORKAROUND_DISABLE_CNP
Zeng Heng (2):
arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
arm64: kernel: Disable CNP on HiSilicon HIP09
Documentation/arch/arm64/silicon-errata.rst | 2 ++
arch/arm64/Kconfig | 20 ++++++++++++++++++++
arch/arm64/include/asm/cpucaps.h | 4 ++--
arch/arm64/kernel/cpu_errata.c | 17 ++++++++++++-----
arch/arm64/kernel/cpufeature.c | 2 +-
arch/arm64/tools/cpucaps | 2 +-
6 files changed, 38 insertions(+), 9 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
2026-06-01 11:19 [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability Zeng Heng
@ 2026-06-01 11:19 ` Zeng Heng
2026-06-02 9:23 ` Vladimir Murzin
2026-06-01 11:20 ` [PATCH v3 2/2] arm64: kernel: Disable CNP on HiSilicon HIP09 Zeng Heng
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Zeng Heng @ 2026-06-01 11:19 UTC (permalink / raw)
To: vladimir.murzin, xuwei5, wangyushan12, yangyicong, maz,
yeoreum.yun, miko.lenczewski, james.clark, corbet, skhan,
kuninori.morimoto.gx, lucaswei, catalin.marinas, broonie,
lpieralisi, thuth, kevin.brodsky, tongtiangen, oupton,
ryan.roberts, mark.rutland, will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/2] arm64: kernel: Disable CNP on HiSilicon HIP09
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-01 11:20 ` Zeng Heng
2026-06-02 9:24 ` Vladimir Murzin
2026-06-02 15:53 ` Will Deacon
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
3 siblings, 2 replies; 8+ messages in thread
From: Zeng Heng @ 2026-06-01 11:20 UTC (permalink / raw)
To: vladimir.murzin, xuwei5, wangyushan12, yangyicong, maz,
yeoreum.yun, miko.lenczewski, james.clark, corbet, skhan,
kuninori.morimoto.gx, lucaswei, catalin.marinas, broonie,
lpieralisi, thuth, kevin.brodsky, tongtiangen, oupton,
ryan.roberts, mark.rutland, will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel
From: Zeng Heng <zengheng4@huawei.com>
HiSilicon HIP09 implements TLB entry matching behavior that deviates
from the ARM architecture specification when the CNP (Common not Private)
bit is set in TTBRx_ELx.
When TTBRx.CNP=1, TLB entries may be incorrectly shared between CPU
cores, leading to TLB conflicts and stale mappings. This affects
coherency and can result in incorrect translations.
Add the hardware erratum workaround (Hisilicon erratum 162100125) to
disable CNP on affected HIP09 cores.
Co-developed-by: Tong Tiangen <tongtiangen@huawei.com>
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
Documentation/arch/arm64/silicon-errata.rst | 2 ++
arch/arm64/Kconfig | 16 ++++++++++++++++
arch/arm64/kernel/cpu_errata.c | 13 ++++++++++---
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index 211119ce7adc..cd50059edb85 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -284,6 +284,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Hisilicon | Hip09 | #162100801 | HISILICON_ERRATUM_162100801 |
+----------------+-----------------+-----------------+-----------------------------+
+| Hisilicon | Hip09 | #162100125 | HISILICON_ERRATUM_162100125 |
++----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |
+----------------+-----------------+-----------------+-----------------------------+
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index f297517a83b9..75638e37883d 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1273,6 +1273,22 @@ config HISILICON_ERRATUM_162100801
If unsure, say Y.
+config HISILICON_ERRATUM_162100125
+ bool "Hisilicon erratum 162100125"
+ default y
+ select ARM64_WORKAROUND_DISABLE_CNP
+ help
+ On HiSilicon HIP09, TLB entry matching behavior when CNP
+ (TTBRx.CNP=1) is enabled differs from the ARM architecture
+ specification.
+
+ TLB entries may be incorrectly shared between CPUs, potentially
+ causing TLB conflicts and stale mappings.
+
+ Disable CNP support for affected HiSilicon HIP09 cores.
+
+ If unsure, say Y.
+
config QCOM_FALKOR_ERRATUM_1003
bool "Falkor E1003: Incorrect translation due to ASID change"
default y
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index b0db946568b7..02e0ee5c948c 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -608,6 +608,14 @@ static const struct midr_range erratum_ac04_cpu_23_list[] = {
};
#endif
+#ifdef CONFIG_ARM64_WORKAROUND_DISABLE_CNP
+static const struct midr_range cnp_erratum_cpus[] = {
+ MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
+ MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
+ {},
+};
+#endif
+
const struct arm64_cpu_capabilities arm64_errata[] = {
#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
{
@@ -803,10 +811,9 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
#endif
#ifdef CONFIG_ARM64_WORKAROUND_DISABLE_CNP
{
- /* NVIDIA Carmel */
- .desc = "NVIDIA Carmel CNP erratum",
+ .desc = "NVIDIA Carmel CNP erratum, or Hisilicon erratum 162100125",
.capability = ARM64_WORKAROUND_DISABLE_CNP,
- ERRATA_MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
+ ERRATA_MIDR_RANGE_LIST(cnp_erratum_cpus),
},
#endif
#ifdef CONFIG_ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
2026-06-01 11:19 ` [PATCH v3 1/2] " Zeng Heng
@ 2026-06-02 9:23 ` Vladimir Murzin
0 siblings, 0 replies; 8+ messages in thread
From: Vladimir Murzin @ 2026-06-02 9:23 UTC (permalink / raw)
To: Zeng Heng, xuwei5, wangyushan12, yangyicong, maz, yeoreum.yun,
miko.lenczewski, james.clark, corbet, skhan, kuninori.morimoto.gx,
lucaswei, catalin.marinas, broonie, lpieralisi, thuth,
kevin.brodsky, tongtiangen, oupton, ryan.roberts, mark.rutland,
will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] arm64: kernel: Disable CNP on HiSilicon HIP09
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
1 sibling, 0 replies; 8+ messages in thread
From: Vladimir Murzin @ 2026-06-02 9:24 UTC (permalink / raw)
To: Zeng Heng, xuwei5, wangyushan12, yangyicong, maz, yeoreum.yun,
miko.lenczewski, james.clark, corbet, skhan, kuninori.morimoto.gx,
lucaswei, catalin.marinas, broonie, lpieralisi, thuth,
kevin.brodsky, tongtiangen, oupton, ryan.roberts, mark.rutland,
will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel
On 6/1/26 12:20, Zeng Heng wrote:
> From: Zeng Heng <zengheng4@huawei.com>
>
> HiSilicon HIP09 implements TLB entry matching behavior that deviates
> from the ARM architecture specification when the CNP (Common not Private)
> bit is set in TTBRx_ELx.
>
> When TTBRx.CNP=1, TLB entries may be incorrectly shared between CPU
> cores, leading to TLB conflicts and stale mappings. This affects
> coherency and can result in incorrect translations.
>
> Add the hardware erratum workaround (Hisilicon erratum 162100125) to
> disable CNP on affected HIP09 cores.
>
> Co-developed-by: Tong Tiangen <tongtiangen@huawei.com>
> Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
> ---
> Documentation/arch/arm64/silicon-errata.rst | 2 ++
> arch/arm64/Kconfig | 16 ++++++++++++++++
> arch/arm64/kernel/cpu_errata.c | 13 ++++++++++---
> 3 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
> index 211119ce7adc..cd50059edb85 100644
> --- a/Documentation/arch/arm64/silicon-errata.rst
> +++ b/Documentation/arch/arm64/silicon-errata.rst
> @@ -284,6 +284,8 @@ stable kernels.
> +----------------+-----------------+-----------------+-----------------------------+
> | Hisilicon | Hip09 | #162100801 | HISILICON_ERRATUM_162100801 |
> +----------------+-----------------+-----------------+-----------------------------+
> +| Hisilicon | Hip09 | #162100125 | HISILICON_ERRATUM_162100125 |
> ++----------------+-----------------+-----------------+-----------------------------+
> +----------------+-----------------+-----------------+-----------------------------+
> | Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |
> +----------------+-----------------+-----------------+-----------------------------+
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index f297517a83b9..75638e37883d 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1273,6 +1273,22 @@ config HISILICON_ERRATUM_162100801
>
> If unsure, say Y.
>
> +config HISILICON_ERRATUM_162100125
> + bool "Hisilicon erratum 162100125"
> + default y
> + select ARM64_WORKAROUND_DISABLE_CNP
> + help
> + On HiSilicon HIP09, TLB entry matching behavior when CNP
> + (TTBRx.CNP=1) is enabled differs from the ARM architecture
> + specification.
> +
> + TLB entries may be incorrectly shared between CPUs, potentially
> + causing TLB conflicts and stale mappings.
> +
> + Disable CNP support for affected HiSilicon HIP09 cores.
> +
> + If unsure, say Y.
> +
> config QCOM_FALKOR_ERRATUM_1003
> bool "Falkor E1003: Incorrect translation due to ASID change"
> default y
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index b0db946568b7..02e0ee5c948c 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -608,6 +608,14 @@ static const struct midr_range erratum_ac04_cpu_23_list[] = {
> };
> #endif
>
> +#ifdef CONFIG_ARM64_WORKAROUND_DISABLE_CNP
> +static const struct midr_range cnp_erratum_cpus[] = {
> + MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
> + MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
> + {},
> +};
> +#endif
> +
> const struct arm64_cpu_capabilities arm64_errata[] = {
> #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
> {
> @@ -803,10 +811,9 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
> #endif
> #ifdef CONFIG_ARM64_WORKAROUND_DISABLE_CNP
> {
> - /* NVIDIA Carmel */
> - .desc = "NVIDIA Carmel CNP erratum",
> + .desc = "NVIDIA Carmel CNP erratum, or Hisilicon erratum 162100125",
> .capability = ARM64_WORKAROUND_DISABLE_CNP,
> - ERRATA_MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
> + ERRATA_MIDR_RANGE_LIST(cnp_erratum_cpus),
> },
> #endif
> #ifdef CONFIG_ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
> --
> 2.43.0
>
FWIW,
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
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-01 11:20 ` [PATCH v3 2/2] arm64: kernel: Disable CNP on HiSilicon HIP09 Zeng Heng
@ 2026-06-02 9:28 ` Vladimir Murzin
2026-06-02 11:54 ` Wei Xu
3 siblings, 0 replies; 8+ messages in thread
From: Vladimir Murzin @ 2026-06-02 9:28 UTC (permalink / raw)
To: Zeng Heng, xuwei5, wangyushan12, yangyicong, maz, yeoreum.yun,
miko.lenczewski, james.clark, corbet, skhan, kuninori.morimoto.gx,
lucaswei, catalin.marinas, broonie, lpieralisi, thuth,
kevin.brodsky, tongtiangen, oupton, ryan.roberts, mark.rutland,
will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel
Hi,
On 6/1/26 12:19, Zeng Heng wrote:
> From: Zeng Heng <zengheng4@huawei.com>
>
> v2: https://lore.kernel.org/all/20260529063132.766491-1-zengheng@huaweicloud.com/
> v1: https://lore.kernel.org/all/20260526015720.206854-1-zengheng@huaweicloud.com/
>
> Changes in v3:
> - Keep CONFIG_ARM64_WORKAROUND_DISABLE_CNP config and generalise
> ARM64_WORKAROUND_DISABLE_CNP capability.
>
> Changes in v2:
> - Unify CNP disable workaround into ARM64_WORKAROUND_DISABLE_CNP
>
> Zeng Heng (2):
> arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
> arm64: kernel: Disable CNP on HiSilicon HIP09
>
> Documentation/arch/arm64/silicon-errata.rst | 2 ++
> arch/arm64/Kconfig | 20 ++++++++++++++++++++
> arch/arm64/include/asm/cpucaps.h | 4 ++--
> arch/arm64/kernel/cpu_errata.c | 17 ++++++++++++-----
> arch/arm64/kernel/cpufeature.c | 2 +-
> arch/arm64/tools/cpucaps | 2 +-
> 6 files changed, 38 insertions(+), 9 deletions(-)
>
> --
> 2.43.0
>
Thanks a lot for going the extra mile and putting everything
together! I have no further comments, but let's give others some
time to chime in.
Cheers
Vladimir
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
2026-06-01 11:19 [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability Zeng Heng
` (2 preceding siblings ...)
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
3 siblings, 0 replies; 8+ messages in thread
From: Wei Xu @ 2026-06-02 11:54 UTC (permalink / raw)
To: Zeng Heng, vladimir.murzin, xuwei5, wangyushan12, yangyicong, maz,
yeoreum.yun, miko.lenczewski, james.clark, corbet, skhan,
kuninori.morimoto.gx, lucaswei, catalin.marinas, broonie,
lpieralisi, thuth, kevin.brodsky, tongtiangen, oupton,
ryan.roberts, mark.rutland, will, Sascha.Bischoff
Cc: linux-arm-kernel, wangkefeng.wang, linux-doc, linux-kernel,
xuwei5
Hi Zeng Heng,
On 2026/6/1 19:19, Zeng Heng wrote:
> From: Zeng Heng <zengheng4@huawei.com>
>
> v2: https://lore.kernel.org/all/20260529063132.766491-1-zengheng@huaweicloud.com/
> v1: https://lore.kernel.org/all/20260526015720.206854-1-zengheng@huaweicloud.com/
>
> Changes in v3:
> - Keep CONFIG_ARM64_WORKAROUND_DISABLE_CNP config and generalise
> ARM64_WORKAROUND_DISABLE_CNP capability.
>
> Changes in v2:
> - Unify CNP disable workaround into ARM64_WORKAROUND_DISABLE_CNP
>
> Zeng Heng (2):
> arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability
> arm64: kernel: Disable CNP on HiSilicon HIP09
>
> Documentation/arch/arm64/silicon-errata.rst | 2 ++
> arch/arm64/Kconfig | 20 ++++++++++++++++++++
> arch/arm64/include/asm/cpucaps.h | 4 ++--
> arch/arm64/kernel/cpu_errata.c | 17 ++++++++++++-----
> arch/arm64/kernel/cpufeature.c | 2 +-
> arch/arm64/tools/cpucaps | 2 +-
> 6 files changed, 38 insertions(+), 9 deletions(-)
>
> --
> 2.43.0
>
> .
>
Thanks, all looks good to me and tested with the 7.1.0-rc1 kernel.
Acked-by: Wei Xu <xuwei5@hisilicon.com>
Tested-by: Wei Xu <xuwei5@hisilicon.com>
Best Regards,
Wei
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] arm64: kernel: Disable CNP on HiSilicon HIP09
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
1 sibling, 0 replies; 8+ messages in thread
From: Will Deacon @ 2026-06-02 15:53 UTC (permalink / raw)
To: Zeng Heng
Cc: vladimir.murzin, xuwei5, wangyushan12, yangyicong, maz,
yeoreum.yun, miko.lenczewski, james.clark, corbet, skhan,
kuninori.morimoto.gx, lucaswei, catalin.marinas, broonie,
lpieralisi, thuth, kevin.brodsky, tongtiangen, oupton,
ryan.roberts, mark.rutland, Sascha.Bischoff, linux-arm-kernel,
wangkefeng.wang, linux-doc, linux-kernel
On Mon, Jun 01, 2026 at 07:20:00PM +0800, Zeng Heng wrote:
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index b0db946568b7..02e0ee5c948c 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -608,6 +608,14 @@ static const struct midr_range erratum_ac04_cpu_23_list[] = {
> };
> #endif
>
> +#ifdef CONFIG_ARM64_WORKAROUND_DISABLE_CNP
> +static const struct midr_range cnp_erratum_cpus[] = {
> + MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
> + MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
> + {},
> +};
> +#endif
Sashiko [1] points out that this means that
CONFIG_HISILICON_ERRATUM_162100125 now affects NVIDIA parts and
vice-versa for CONFIG_NVIDIA_CARMEL_CNP_ERRATUM.
The easiest fix is probably to guard the entries in the array above with
their respective config options? Otherwise, this all looks good to me.
Will
[1] https://sashiko.dev/#/patchset/20260601112000.1145391-1-zengheng@huaweicloud.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-06-02 15:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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-02 9:28 ` [PATCH v3 0/2] arm64: cpufeature: Add WORKAROUND_DISABLE_CNP capability Vladimir Murzin
2026-06-02 11:54 ` Wei Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox