diff --git a/docs/design/cpu-specific-build-macros.rst b/docs/design/cpu-specific-build-macros.rst index f4c2312a8..463790859 100644 --- a/docs/design/cpu-specific-build-macros.rst +++ b/docs/design/cpu-specific-build-macros.rst @@ -578,6 +578,12 @@ For Neoverse V2, the following errata build flags are defined : CPU, this affects all configurations. This needs to be enabled for revisions r0p0 and r0p1. It has been fixed in r0p2. +For Neoverse V3, the following errata build flags are defined : + +- ``ERRATA_V3_3701767``: This applies errata 3701767 workaround to Neoverse-V3 + CPU. This needs to be enabled for revisions r0p0, r0p1, r0p2 of the CPU and + is still open. + For Cortex-A710, the following errata build flags are defined : - ``ERRATA_A710_1987031``: This applies errata 1987031 workaround to diff --git a/include/lib/cpus/aarch64/neoverse_v3.h b/include/lib/cpus/aarch64/neoverse_v3.h index a31bdd3aa..5a828c0c7 100644 --- a/include/lib/cpus/aarch64/neoverse_v3.h +++ b/include/lib/cpus/aarch64/neoverse_v3.h @@ -30,4 +30,8 @@ ******************************************************************************/ #define NEOVERSE_V3_CPUACTLR6_EL1 S3_0_C15_C8_1 +#ifndef __ASSEMBLER__ +long check_erratum_neoverse_v3_3701767(long cpu_rev); +#endif /* __ASSEMBLER__ */ + #endif /* NEOVERSE_V3_H */ diff --git a/lib/cpus/aarch64/neoverse_v3.S b/lib/cpus/aarch64/neoverse_v3.S index 69b66278d..7fe2d7fa2 100644 --- a/lib/cpus/aarch64/neoverse_v3.S +++ b/lib/cpus/aarch64/neoverse_v3.S @@ -22,6 +22,12 @@ #error "Neoverse V3 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0" #endif +.global check_erratum_neoverse_v3_3701767 + +add_erratum_entry neoverse_v3, ERRATUM(3701767), ERRATA_V3_3701767, NO_APPLY_AT_RESET + +check_erratum_ls neoverse_v3, ERRATUM(3701767), CPU_REV(0, 2) + #if WORKAROUND_CVE_2022_23960 wa_cve_2022_23960_bhb_vector_table NEOVERSE_V3_BHB_LOOP_COUNT, neoverse_v3 #endif /* WORKAROUND_CVE_2022_23960 */ diff --git a/lib/cpus/cpu-ops.mk b/lib/cpus/cpu-ops.mk index be4ce7739..fb904e232 100644 --- a/lib/cpus/cpu-ops.mk +++ b/lib/cpus/cpu-ops.mk @@ -564,6 +564,11 @@ CPU_FLAG_LIST += ERRATA_V1_2743233 # still open. CPU_FLAG_LIST += ERRATA_V1_2779461 +# Flag to apply erratum 3701767 workaround during context save/restore of +# ICH_VMCR_EL2 reg. This erratum applies to revisions r0p0, r0p1 and r0p2 of +# the Neoverse V3 cpu and is still open. +CPU_FLAG_LIST += ERRATA_V3_3701767 + # Flag to apply erratum 1987031 workaround during reset. This erratum applies # to revisions r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is still open. CPU_FLAG_LIST += ERRATA_A710_1987031 diff --git a/lib/cpus/errata_common.c b/lib/cpus/errata_common.c index fd7a387e4..a39143031 100644 --- a/lib/cpus/errata_common.c +++ b/lib/cpus/errata_common.c @@ -23,6 +23,7 @@ #include #include #include +#include #if ERRATA_A520_2938996 || ERRATA_X4_2726228 unsigned int check_if_affected_core(void) @@ -130,6 +131,14 @@ bool errata_ich_vmcr_el2_applies(void) return true; break; #endif /* ERRATA_N3_3699563 */ + +#if ERRATA_V3_3701767 + case EXTRACT_PARTNUM(NEOVERSE_V3_MIDR): + if (check_erratum_neoverse_v3_3701767(cpu_get_rev_var()) == ERRATA_APPLIES) + return true; + break; +#endif /* ERRATA_V3_3701767 */ + default: break; }