Skip to content

Commit 708e8af

Browse files
Anshuman Khandualmathieupoirier
authored andcommitted
arm64: errata: Add detection for TRBE trace data corruption
TRBE implementations affected by Arm erratum #1902691 might corrupt trace data or deadlock, when it's being written into the memory. So effectively TRBE is broken and hence cannot be used to capture trace data. This adds a new errata ARM64_ERRATUM_1902691 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 3bd94a8 commit 708e8af

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
@@ -56,6 +56,8 @@ stable kernels.
5656
+----------------+-----------------+-----------------+-----------------------------+
5757
| ARM | Cortex-A510 | #2038923 | ARM64_ERRATUM_2038923 |
5858
+----------------+-----------------+-----------------+-----------------------------+
59+
| ARM | Cortex-A510 | #1902691 | ARM64_ERRATUM_1902691 |
60+
+----------------+-----------------+-----------------+-----------------------------+
5961
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
6062
+----------------+-----------------+-----------------+-----------------------------+
6163
| ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |

arch/arm64/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,24 @@ config ARM64_ERRATUM_2038923
819819

820820
If unsure, say Y.
821821

822+
config ARM64_ERRATUM_1902691
823+
bool "Cortex-A510: 1902691: workaround TRBE trace corruption"
824+
depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
825+
default y
826+
help
827+
This option adds the workaround for ARM Cortex-A510 erratum 1902691.
828+
829+
Affected Cortex-A510 core might cause trace data corruption, when being written
830+
into the memory. Effectively TRBE is broken and hence cannot be used to capture
831+
trace data.
832+
833+
Work around this problem in the driver by just preventing TRBE initialization on
834+
affected cpus. The firmware must have disabled the access to TRBE for the kernel
835+
on such implementations. This will cover the kernel for any firmware that doesn't
836+
do this already.
837+
838+
If unsure, say Y.
839+
822840
config CAVIUM_ERRATUM_22375
823841
bool "Cavium erratum 22375, 24313"
824842
default y

arch/arm64/kernel/cpu_errata.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
615615
/* Cortex-A510 r0p0 - r0p2 */
616616
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
617617
},
618+
#endif
619+
#ifdef CONFIG_ARM64_ERRATUM_1902691
620+
{
621+
.desc = "ARM erratum 1902691",
622+
.capability = ARM64_WORKAROUND_1902691,
623+
624+
/* Cortex-A510 r0p0 - r0p1 */
625+
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 1)
626+
},
618627
#endif
619628
{
620629
}

arch/arm64/tools/cpucaps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ WORKAROUND_1508412
5757
WORKAROUND_1542419
5858
WORKAROUND_2064142
5959
WORKAROUND_2038923
60+
WORKAROUND_1902691
6061
WORKAROUND_TRBE_OVERWRITE_FILL_MODE
6162
WORKAROUND_TSB_FLUSH_FAILURE
6263
WORKAROUND_TRBE_WRITE_OUT_OF_RANGE

0 commit comments

Comments
 (0)