Skip to content

Commit f827bcd

Browse files
robherringwilldeacon
authored andcommitted
arm64: errata: Add Cortex-A510 speculative unprivileged load workaround
Implement the workaround for ARM Cortex-A510 erratum 3117295. On an affected Cortex-A510 core, a speculatively executed unprivileged load might leak data from a privileged load via a cache side channel. The issue only exists for loads within a translation regime with the same translation (e.g. same ASID and VMID). Therefore, the issue only affects the return to EL0. The erratum and workaround are the same as ARM Cortex-A520 erratum 2966298, so reuse the existing workaround. Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 546b7cd commit f827bcd

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ stable kernels.
7171
+----------------+-----------------+-----------------+-----------------------------+
7272
| ARM | Cortex-A510 | #2658417 | ARM64_ERRATUM_2658417 |
7373
+----------------+-----------------+-----------------+-----------------------------+
74+
| ARM | Cortex-A510 | #3117295 | ARM64_ERRATUM_3117295 |
75+
+----------------+-----------------+-----------------+-----------------------------+
7476
| ARM | Cortex-A520 | #2966298 | ARM64_ERRATUM_2966298 |
7577
+----------------+-----------------+-----------------+-----------------------------+
7678
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |

arch/arm64/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,20 @@ config ARM64_ERRATUM_2966298
10541054

10551055
If unsure, say Y.
10561056

1057+
config ARM64_ERRATUM_3117295
1058+
bool "Cortex-A510: 3117295: workaround for speculatively executed unprivileged load"
1059+
select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
1060+
default y
1061+
help
1062+
This option adds the workaround for ARM Cortex-A510 erratum 3117295.
1063+
1064+
On an affected Cortex-A510 core, a speculatively executed unprivileged
1065+
load might leak data from a privileged level via a cache side channel.
1066+
1067+
Work around this problem by executing a TLBI before returning to EL0.
1068+
1069+
If unsure, say Y.
1070+
10571071
config CAVIUM_ERRATUM_22375
10581072
bool "Cavium erratum 22375, 24313"
10591073
default y

arch/arm64/kernel/cpu_errata.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,19 @@ static struct midr_range broken_aarch32_aes[] = {
416416
};
417417
#endif /* CONFIG_ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE */
418418

419+
#ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
420+
static const struct midr_range erratum_spec_unpriv_load_list[] = {
421+
#ifdef CONFIG_ARM64_ERRATUM_3117295
422+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A510),
423+
#endif
424+
#ifdef CONFIG_ARM64_ERRATUM_2966298
425+
/* Cortex-A520 r0p0 to r0p1 */
426+
MIDR_REV_RANGE(MIDR_CORTEX_A520, 0, 0, 1),
427+
#endif
428+
{},
429+
};
430+
#endif
431+
419432
const struct arm64_cpu_capabilities arm64_errata[] = {
420433
#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
421434
{
@@ -715,10 +728,10 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
715728
#endif
716729
#ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
717730
{
718-
.desc = "ARM erratum 2966298",
731+
.desc = "ARM errata 2966298, 3117295",
719732
.capability = ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD,
720733
/* Cortex-A520 r0p0 - r0p1 */
721-
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A520, 0, 0, 1),
734+
ERRATA_MIDR_RANGE_LIST(erratum_spec_unpriv_load_list),
722735
},
723736
#endif
724737
#ifdef CONFIG_AMPERE_ERRATUM_AC03_CPU_38

0 commit comments

Comments
 (0)