Skip to content

Commit 9405447

Browse files
Marc Zyngierwilldeacon
authored andcommitted
arm64: Avoid Cavium TX2 erratum 219 when switching TTBR
As a PRFM instruction racing against a TTBR update can have undesirable effects on TX2, NOP-out such PRFM on cores that are affected by the TX2-219 erratum. Cc: <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 93916be commit 9405447

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

arch/arm64/include/asm/cpucaps.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
#define ARM64_HAS_DCPODP 43
5454
#define ARM64_WORKAROUND_1463225 44
5555
#define ARM64_WORKAROUND_CAVIUM_TX2_219_TVM 45
56+
#define ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM 46
5657

57-
#define ARM64_NCAPS 46
58+
#define ARM64_NCAPS 47
5859

5960
#endif /* __ASM_CPUCAPS_H */

arch/arm64/kernel/cpu_errata.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
884884
ERRATA_MIDR_RANGE_LIST(tx2_family_cpus),
885885
.matches = needs_tx2_tvm_workaround,
886886
},
887+
{
888+
.desc = "Cavium ThunderX2 erratum 219 (PRFM removal)",
889+
.capability = ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM,
890+
ERRATA_MIDR_RANGE_LIST(tx2_family_cpus),
891+
},
887892
#endif
888893
{
889894
}

arch/arm64/kernel/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,9 @@ alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003
10701070
#else
10711071
ldr x30, =vectors
10721072
#endif
1073+
alternative_if_not ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM
10731074
prfm plil1strm, [x30, #(1b - tramp_vectors)]
1075+
alternative_else_nop_endif
10741076
msr vbar_el1, x30
10751077
add x30, x30, #(1b - tramp_vectors)
10761078
isb

0 commit comments

Comments
 (0)