]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: kernel: Disable CNP on HiSilicon HIP09
authorZeng Heng <zengheng4@huawei.com>
Wed, 3 Jun 2026 06:20:25 +0000 (14:20 +0800)
committerWill Deacon <will@kernel.org>
Wed, 3 Jun 2026 11:43:28 +0000 (12:43 +0100)
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>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Will Deacon <will@kernel.org>
Documentation/arch/arm64/silicon-errata.rst
arch/arm64/Kconfig
arch/arm64/kernel/cpu_errata.c

index 046a7fa4706336a9bdb7db6c636eff1fc9257da7..61c2fd7ef6441273fd97ab0720c5432888fbd054 100644 (file)
@@ -287,6 +287,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    |
 +----------------+-----------------+-----------------+-----------------------------+
index f297517a83b908384690fb9af5a1d3bcfdea88aa..75638e37883db565cf78069746741ce2e6620d7b 100644 (file)
@@ -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
index 08eb9d6545d135281671414c3d9f5e9d2e3b9877..310e6f120992d060cce9f209bdbd5c931304d61a 100644 (file)
@@ -612,6 +612,9 @@ static const struct midr_range erratum_ac04_cpu_23_list[] = {
 static const struct midr_range cnp_erratum_cpus[] = {
 #ifdef CONFIG_NVIDIA_CARMEL_CNP_ERRATUM
        MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
+#endif
+#ifdef CONFIG_HISILICON_ERRATUM_162100125
+       MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
 #endif
        {},
 };
@@ -812,8 +815,7 @@ 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_RANGE_LIST(cnp_erratum_cpus),
        },