Skip to content

Commit 607a9af

Browse files
Anshuman Khandualmathieupoirier
authored andcommitted
arm64: errata: Add detection for TRBE ignored system register writes
TRBE implementations affected by Arm erratum #2064142 might fail to write into certain system registers after the TRBE has been disabled. Under some conditions after TRBE has been disabled, writes into certain TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1 and TRBTRG_EL1 will be ignored and not be effected. This adds a new errata ARM64_ERRATUM_2064142 in arm64 errata framework. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: Suzuki Poulose <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Reviewed-by: Suzuki K Poulose <[email protected]> Acked-by: Catalin Marinas <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 53960fa commit 607a9af

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ stable kernels.
5252
| Allwinner | A64/R18 | UNKNOWN1 | SUN50I_ERRATUM_UNKNOWN1 |
5353
+----------------+-----------------+-----------------+-----------------------------+
5454
+----------------+-----------------+-----------------+-----------------------------+
55+
| ARM | Cortex-A510 | #2064142 | ARM64_ERRATUM_2064142 |
56+
+----------------+-----------------+-----------------+-----------------------------+
5557
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
5658
+----------------+-----------------+-----------------+-----------------------------+
5759
| ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |

arch/arm64/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,24 @@ config ARM64_ERRATUM_2224489
778778

779779
If unsure, say Y.
780780

781+
config ARM64_ERRATUM_2064142
782+
bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
783+
depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
784+
default y
785+
help
786+
This option adds the workaround for ARM Cortex-A510 erratum 2064142.
787+
788+
Affected Cortex-A510 core might fail to write into system registers after the
789+
TRBE has been disabled. Under some conditions after the TRBE has been disabled
790+
writes into TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1,
791+
and TRBTRG_EL1 will be ignored and will not be effected.
792+
793+
Work around this in the driver by executing TSB CSYNC and DSB after collection
794+
is stopped and before performing a system register write to one of the affected
795+
registers.
796+
797+
If unsure, say Y.
798+
781799
config CAVIUM_ERRATUM_22375
782800
bool "Cavium erratum 22375, 24313"
783801
default y

arch/arm64/kernel/cpu_errata.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,15 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
597597
.type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
598598
CAP_MIDR_RANGE_LIST(trbe_write_out_of_range_cpus),
599599
},
600+
#endif
601+
#ifdef CONFIG_ARM64_ERRATUM_2064142
602+
{
603+
.desc = "ARM erratum 2064142",
604+
.capability = ARM64_WORKAROUND_2064142,
605+
606+
/* Cortex-A510 r0p0 - r0p2 */
607+
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
608+
},
600609
#endif
601610
{
602611
}

arch/arm64/tools/cpucaps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ WORKAROUND_1418040
5555
WORKAROUND_1463225
5656
WORKAROUND_1508412
5757
WORKAROUND_1542419
58+
WORKAROUND_2064142
5859
WORKAROUND_TRBE_OVERWRITE_FILL_MODE
5960
WORKAROUND_TSB_FLUSH_FAILURE
6061
WORKAROUND_TRBE_WRITE_OUT_OF_RANGE

0 commit comments

Comments
 (0)