diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index 9d6d13045a55..a515d01266ae 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -159,6 +159,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A78C | #4193794 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A710 | #3696244 | ARM64_ERRATUM_3696244 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 |
@@ -189,6 +191,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X1C | #4193792 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-X2 | #3696244 | ARM64_ERRATUM_3696244 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 |
@@ -197,16 +201,20 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X2 | #4193788 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-X3 | #3696239 | ARM64_ERRATUM_3696239 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X3 | #3324335 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X3 | #4193786 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
-| ARM | Cortex-X4 | #3043263 | N/A |
+| ARM | Cortex-X4 | #3043263 | ARM64_ERRATUM_3043263 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X4 | #3194386 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X4 | #4118414 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-X925 | #3043240 | ARM64_ERRATUM_3043240 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X925 | #3324334 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-X925 | #4193781 | ARM64_ERRATUM_4118414 |
@@ -223,6 +231,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-N1 | #4193800 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Neoverse-N2 | #3696250 | ARM64_ERRATUM_3696250 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-N2 | #2139208 | ARM64_ERRATUM_2139208 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-N2 | #2067961 | ARM64_ERRATUM_2067961 |
@@ -235,38 +245,44 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-N3 | #3456111 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Neoverse-V1 | #3696285 | ARM64_ERRATUM_3696285 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V1 | #1619801 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V1 | #4193790 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Neoverse-V2 | #3696242 | ARM64_ERRATUM_3696242 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V2 | #4193787 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
-| ARM | Neoverse-V3 | #3053180 | N/A |
+| ARM | Neoverse-V3 | #3053180 | ARM64_ERRATUM_3053180 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V3 | #4193784 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
-| ARM | Neoverse-V3AE | #3053180 | N/A |
+| ARM | Neoverse-V3AE | #3053180 | ARM64_ERRATUM_3053180 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V3AE | #4193784 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
-| ARM | C1-Premium | #3683289 | N/A |
+| ARM | C1-Premium | #3683289 | ARM64_ERRATUM_3683289 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | C1-Premium | #4193780 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | C1-Pro | #4193714 | ARM64_ERRATUM_4193714 |
+----------------+-----------------+-----------------+-----------------------------+
-| ARM | C1-Ultra | #3683289 | N/A |
+| ARM | C1-Ultra | #3683289 | ARM64_ERRATUM_3683289 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | C1-Ultra | #4193780 | ARM64_ERRATUM_4118414 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | C2-Ultra | #4196850 | ARM64_ERRATUM_4196850 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | MMU-500 | #562869, | ARM_SMMU_MMU_500_CPRE_ERRATA|
| | | #841119, | |
| | | #826419, | |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 1075bc661833..79c92805c694 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1248,6 +1248,169 @@ config ARM64_ERRATUM_4118414
If unsure, say Y.
+config ARM64_ERRATUM_3043240
+ bool "Cortex-X925: 3043240: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Cortex-X925 erratum 3043240,
+ which affects r0p0, r0p1 and r0p2. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Cortex-X925 from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3043263
+ bool "Cortex-X4: 3043263: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Cortex-X4 erratum 3043263,
+ which affects r0p0, r0p1, r0p2 and r0p3. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Cortex-X4 from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3053180
+ bool "Neoverse-V3/V3AE: 3053180: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Neoverse-V3 and Neoverse-V3AE
+ erratum 3053180, which affects r0p0, r0p1 and r0p2. Contrary to earlier
+ errata notices, r0p2 is affected. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Neoverse-V3 and
+ Neoverse-V3AE from the BBML3 allow list, so Linux uses break-before-make.
+ Disabling this option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3683289
+ bool "C1-Ultra/Premium: 3683289: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm C1-Ultra and C1-Premium erratum
+ 3683289, which affects r0p0 and r1p0 and is fixed in r1p1.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding revisions earlier than r1p1 from the
+ BBML3 allow list, so Linux uses break-before-make on affected CPUs.
+ Disabling this option allows BBML3 to be used on all revisions.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3696239
+ bool "Cortex-X3: 3696239: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Cortex-X3 erratum 3696239,
+ which affects r0p0, r1p0, r1p1 and r1p2. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Cortex-X3 from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3696242
+ bool "Neoverse-V2: 3696242: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Neoverse-V2 erratum 3696242,
+ which affects r0p0, r0p1 and r0p2. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Neoverse-V2 from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3696244
+ bool "Cortex-A710/X2: 3696244: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Cortex-A710 and Cortex-X2
+ erratum 3696244, which affects r0p0, r1p0, r2p0 and r2p1. No fixed
+ revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Cortex-A710 and
+ Cortex-X2 from the BBML3 allow list, so Linux uses break-before-make.
+ Disabling this option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3696250
+ bool "Neoverse-N2: 3696250: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Neoverse-N2 erratum 3696250,
+ which affects r0p0, r0p1, r0p2 and r0p3. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Neoverse-N2 from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_3696285
+ bool "Neoverse-V1: 3696285: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm Neoverse-V1 erratum 3696285,
+ which affects r0p0, r1p0, r1p1 and r1p2. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of Neoverse-V1 from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
+config ARM64_ERRATUM_4196850
+ bool "C2-Ultra: 4196850: BBM-related livelock"
+ default y
+ help
+ This option adds the workaround for Arm C2-Ultra erratum 4196850,
+ which affects r0p0 and r0p1. Contrary to earlier errata notices, r0p1
+ is affected. No fixed revision is known.
+
+ Changing mapping size without break-before-make or using inconsistent
+ contiguous hints can cause a load or store to livelock.
+
+ Work around this by excluding all revisions of C2-Ultra from the
+ BBML3 allow list, so Linux uses break-before-make. Disabling this
+ option allows BBML3 to be used on these CPUs.
+
+ If unsure, say Y.
+
config CAVIUM_ERRATUM_22375
bool "Cavium erratum 22375, 24313"
default y
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 8819652a67ed..aa6f4c8c1052 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -2016,15 +2016,50 @@ bool cpu_supports_bbml3(void)
MIDR_ALL_VERSIONS(MIDR_AMPERE1),
MIDR_ALL_VERSIONS(MIDR_AMPERE1A),
MIDR_ALL_VERSIONS(MIDR_CORTEX_A520AE),
+#ifndef CONFIG_ARM64_ERRATUM_3696244
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
+#endif
MIDR_ALL_VERSIONS(MIDR_CORTEX_A715),
MIDR_ALL_VERSIONS(MIDR_CORTEX_A720AE),
MIDR_ALL_VERSIONS(MIDR_CORTEX_A725),
+#ifndef CONFIG_ARM64_ERRATUM_3696244
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_3696239
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_3043263
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_X4),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_3043240
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_X925),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_3696250
+ MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
+#endif
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N3),
+#ifndef CONFIG_ARM64_ERRATUM_3696285
+ MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_3696242
+ MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_3053180
+ MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
+ MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3AE),
+#endif
MIDR_ALL_VERSIONS(MIDR_C1_NANO),
MIDR_ALL_VERSIONS(MIDR_C1_PRO),
- /* Erratum 3683289 fixed in r1p1 */
+#ifndef CONFIG_ARM64_ERRATUM_3683289
+ MIDR_ALL_VERSIONS(MIDR_C1_ULTRA),
+ MIDR_ALL_VERSIONS(MIDR_C1_PREMIUM),
+#else
MIDR_RANGE(MIDR_C1_ULTRA, 1, 1, 0xf, 0xf),
MIDR_RANGE(MIDR_C1_PREMIUM, 1, 1, 0xf, 0xf),
+#endif
+#ifndef CONFIG_ARM64_ERRATUM_4196850
+ MIDR_ALL_VERSIONS(MIDR_C2_ULTRA),
+#endif
{}
};
u64 mmfr2 = __read_sysreg_by_encoding(SYS_ID_AA64MMFR2_EL1);--
2.43.0