Skip to content

Commit adeec61

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: errata: Expand speculative SSBS workaround (again)
A number of Arm Ltd CPUs suffer from errata whereby an MSR to the SSBS special-purpose register does not affect subsequent speculative instructions, permitting speculative store bypassing for a window of time. We worked around this for a number of CPUs in commits: * 7187bb7 ("arm64: errata: Add workaround for Arm errata 3194386 and 3312417") * 75b3c43 ("arm64: errata: Expand speculative SSBS workaround") Since then, similar errata have been published for a number of other Arm Ltd CPUs, for which the same mitigation is sufficient. This is described in their respective Software Developer Errata Notice (SDEN) documents: * Cortex-A76 (MP052) SDEN v31.0, erratum 3324349 https://developer.arm.com/documentation/SDEN-885749/3100/ * Cortex-A77 (MP074) SDEN v19.0, erratum 3324348 https://developer.arm.com/documentation/SDEN-1152370/1900/ * Cortex-A78 (MP102) SDEN v21.0, erratum 3324344 https://developer.arm.com/documentation/SDEN-1401784/2100/ * Cortex-A78C (MP138) SDEN v16.0, erratum 3324346 https://developer.arm.com/documentation/SDEN-1707916/1600/ * Cortex-A78C (MP154) SDEN v10.0, erratum 3324347 https://developer.arm.com/documentation/SDEN-2004089/1000/ * Cortex-A725 (MP190) SDEN v5.0, erratum 3456106 https://developer.arm.com/documentation/SDEN-2832921/0500/ * Cortex-X1 (MP077) SDEN v21.0, erratum 3324344 https://developer.arm.com/documentation/SDEN-1401782/2100/ * Cortex-X1C (MP136) SDEN v16.0, erratum 3324346 https://developer.arm.com/documentation/SDEN-1707914/1600/ * Neoverse-N1 (MP050) SDEN v32.0, erratum 3324349 https://developer.arm.com/documentation/SDEN-885747/3200/ * Neoverse-V1 (MP076) SDEN v19.0, erratum 3324341 https://developer.arm.com/documentation/SDEN-1401781/1900/ Note that due to the manner in which Arm develops IP and tracks errata, some CPUs share a common erratum number and some CPUs have multiple erratum numbers for the same HW issue. On parts without SB, it is necessary to use ISB for the workaround. The spec_bar() macro used in the mitigation will expand to a "DSB SY; ISB" sequence in this case, which is sufficient on all affected parts. Enable the existing mitigation by adding the relevant MIDRs to erratum_spec_ssbs_list. The list is sorted alphanumerically (involving moving Neoverse-V3 after Neoverse-V2) so that this is easy to audit and potentially extend again in future. The Kconfig text is also updated to clarify the set of affected parts and the mitigation. Signed-off-by: Mark Rutland <[email protected]> Cc: James Morse <[email protected]> Cc: Will Deacon <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 9ef54a3 commit adeec61

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,18 @@ stable kernels.
122122
+----------------+-----------------+-----------------+-----------------------------+
123123
| ARM | Cortex-A76 | #1490853 | N/A |
124124
+----------------+-----------------+-----------------+-----------------------------+
125+
| ARM | Cortex-A76 | #3324349 | ARM64_ERRATUM_3194386 |
126+
+----------------+-----------------+-----------------+-----------------------------+
125127
| ARM | Cortex-A77 | #1491015 | N/A |
126128
+----------------+-----------------+-----------------+-----------------------------+
127129
| ARM | Cortex-A77 | #1508412 | ARM64_ERRATUM_1508412 |
128130
+----------------+-----------------+-----------------+-----------------------------+
131+
| ARM | Cortex-A77 | #3324348 | ARM64_ERRATUM_3194386 |
132+
+----------------+-----------------+-----------------+-----------------------------+
133+
| ARM | Cortex-A78 | #3324344 | ARM64_ERRATUM_3194386 |
134+
+----------------+-----------------+-----------------+-----------------------------+
135+
| ARM | Cortex-A78C | #3324346,3324347| ARM64_ERRATUM_3194386 |
136+
+----------------+-----------------+-----------------+-----------------------------+
129137
| ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 |
130138
+----------------+-----------------+-----------------+-----------------------------+
131139
| ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 |
@@ -138,8 +146,14 @@ stable kernels.
138146
+----------------+-----------------+-----------------+-----------------------------+
139147
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
140148
+----------------+-----------------+-----------------+-----------------------------+
149+
| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
150+
+----------------+-----------------+-----------------+-----------------------------+
141151
| ARM | Cortex-X1 | #1502854 | N/A |
142152
+----------------+-----------------+-----------------+-----------------------------+
153+
| ARM | Cortex-X1 | #3324344 | ARM64_ERRATUM_3194386 |
154+
+----------------+-----------------+-----------------+-----------------------------+
155+
| ARM | Cortex-X1C | #3324346 | ARM64_ERRATUM_3194386 |
156+
+----------------+-----------------+-----------------+-----------------------------+
143157
| ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 |
144158
+----------------+-----------------+-----------------+-----------------------------+
145159
| ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 |
@@ -160,6 +174,8 @@ stable kernels.
160174
+----------------+-----------------+-----------------+-----------------------------+
161175
| ARM | Neoverse-N1 | #1542419 | ARM64_ERRATUM_1542419 |
162176
+----------------+-----------------+-----------------+-----------------------------+
177+
| ARM | Neoverse-N1 | #3324349 | ARM64_ERRATUM_3194386 |
178+
+----------------+-----------------+-----------------+-----------------------------+
163179
| ARM | Neoverse-N2 | #2139208 | ARM64_ERRATUM_2139208 |
164180
+----------------+-----------------+-----------------+-----------------------------+
165181
| ARM | Neoverse-N2 | #2067961 | ARM64_ERRATUM_2067961 |
@@ -170,6 +186,8 @@ stable kernels.
170186
+----------------+-----------------+-----------------+-----------------------------+
171187
| ARM | Neoverse-V1 | #1619801 | N/A |
172188
+----------------+-----------------+-----------------+-----------------------------+
189+
| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
190+
+----------------+-----------------+-----------------+-----------------------------+
173191
| ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 |
174192
+----------------+-----------------+-----------------+-----------------------------+
175193
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |

arch/arm64/Kconfig

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,30 +1069,40 @@ config ARM64_ERRATUM_3117295
10691069
If unsure, say Y.
10701070

10711071
config ARM64_ERRATUM_3194386
1072-
bool "Cortex-{A720,X4,X925}/Neoverse-V3: workaround for MSR SSBS not self-synchronizing"
1072+
bool "Cortex-*/Neoverse-*: workaround for MSR SSBS not self-synchronizing"
10731073
default y
10741074
help
10751075
This option adds the workaround for the following errata:
10761076

1077+
* ARM Cortex-A76 erratum 3324349
1078+
* ARM Cortex-A77 erratum 3324348
1079+
* ARM Cortex-A78 erratum 3324344
1080+
* ARM Cortex-A78C erratum 3324346
1081+
* ARM Cortex-A78C erratum 3324347
10771082
* ARM Cortex-A710 erratam 3324338
10781083
* ARM Cortex-A720 erratum 3456091
1084+
* ARM Cortex-A725 erratum 3456106
1085+
* ARM Cortex-X1 erratum 3324344
1086+
* ARM Cortex-X1C erratum 3324346
10791087
* ARM Cortex-X2 erratum 3324338
10801088
* ARM Cortex-X3 erratum 3324335
10811089
* ARM Cortex-X4 erratum 3194386
10821090
* ARM Cortex-X925 erratum 3324334
1091+
* ARM Neoverse-N1 erratum 3324349
10831092
* ARM Neoverse N2 erratum 3324339
1093+
* ARM Neoverse-V1 erratum 3324341
10841094
* ARM Neoverse V2 erratum 3324336
10851095
* ARM Neoverse-V3 erratum 3312417
10861096

10871097
On affected cores "MSR SSBS, #0" instructions may not affect
10881098
subsequent speculative instructions, which may permit unexepected
10891099
speculative store bypassing.
10901100

1091-
Work around this problem by placing a speculation barrier after
1092-
kernel changes to SSBS. The presence of the SSBS special-purpose
1093-
register is hidden from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such
1094-
that userspace will use the PR_SPEC_STORE_BYPASS prctl to change
1095-
SSBS.
1101+
Work around this problem by placing a Speculation Barrier (SB) or
1102+
Instruction Synchronization Barrier (ISB) after kernel changes to
1103+
SSBS. The presence of the SSBS special-purpose register is hidden
1104+
from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such that userspace
1105+
will use the PR_SPEC_STORE_BYPASS prctl to change SSBS.
10961106

10971107
If unsure, say Y.
10981108

arch/arm64/kernel/cpu_errata.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,24 @@ static const struct midr_range erratum_spec_unpriv_load_list[] = {
434434

435435
#ifdef CONFIG_ARM64_ERRATUM_3194386
436436
static const struct midr_range erratum_spec_ssbs_list[] = {
437+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A76),
438+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
439+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
440+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C),
437441
MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
438442
MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
443+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A725),
444+
MIDR_ALL_VERSIONS(MIDR_CORTEX_X1),
445+
MIDR_ALL_VERSIONS(MIDR_CORTEX_X1C),
439446
MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
440447
MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
441448
MIDR_ALL_VERSIONS(MIDR_CORTEX_X4),
442449
MIDR_ALL_VERSIONS(MIDR_CORTEX_X925),
450+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
443451
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
444-
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
452+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
445453
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
454+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
446455
{}
447456
};
448457
#endif

0 commit comments

Comments
 (0)