fix(cpus): workaround for Cortex-X925 erratum 3701747

Cortex-X925 erratum 3701747 that applies to r0p0, r0p1 and is still
Open.

The workaround is for EL3 software that performs context save/restore
on a change of Security state to use a value of SCR_EL3.NS when
accessing ICH_VMCR_EL2 that reflects the Security state that owns the
data being saved or restored.

SDEN documentation:
https://developer.arm.com/documentation/109180/latest/

Change-Id: I080296666f89276b3260686c2bdb8de63fc174c1
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
This commit is contained in:
Govindraj Raja 2025-01-21 18:38:56 -06:00
parent 38401c5388
commit 511148ef50
5 changed files with 27 additions and 0 deletions

View file

@ -874,6 +874,11 @@ For Cortex-X4, the following errata build flags are defined :
CPU. This needs to be enabled for revisions r0p0, r0p1, r0p2 and r0p3. CPU. This needs to be enabled for revisions r0p0, r0p1, r0p2 and r0p3.
It is still open. It is still open.
For Cortex-X925, the following errata build flags are defined :
- ``ERRATA_X925_3701747``: This applies errata 3701747 workaround to Cortex-X925
CPU. This needs to be enabled for revisions r0p0 and r0p1. It is still open.
For Cortex-A510, the following errata build flags are defined : For Cortex-A510, the following errata build flags are defined :
- ``ERRATA_A510_1922240``: This applies errata 1922240 workaround to - ``ERRATA_A510_1922240``: This applies errata 1922240 workaround to

View file

@ -26,4 +26,8 @@
******************************************************************************/ ******************************************************************************/
#define CORTEX_X925_CPUACTLR6_EL1 S3_0_C15_C8_1 #define CORTEX_X925_CPUACTLR6_EL1 S3_0_C15_C8_1
#ifndef __ASSEMBLER__
long check_erratum_cortex_x925_3701747(long cpu_rev);
#endif /* __ASSEMBLER__ */
#endif /* CORTEX_X925_H */ #endif /* CORTEX_X925_H */

View file

@ -21,6 +21,12 @@
#error "Cortex-X925 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0" #error "Cortex-X925 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
#endif #endif
.global check_erratum_cortex_x925_3701747
add_erratum_entry cortex_x925, ERRATUM(3701747), ERRATA_X925_3701747, NO_APPLY_AT_RESET
check_erratum_ls cortex_x925, ERRATUM(3701747), CPU_REV(0, 1)
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */ /* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
workaround_reset_start cortex_x925, CVE(2024, 5660), WORKAROUND_CVE_2024_5660 workaround_reset_start cortex_x925, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
sysreg_bit_set CORTEX_X925_CPUECTLR_EL1, BIT(46) sysreg_bit_set CORTEX_X925_CPUECTLR_EL1, BIT(46)

View file

@ -879,6 +879,11 @@ CPU_FLAG_LIST += ERRATA_X4_3076789
# of the Cortex-X4 cpu and is still open. # of the Cortex-X4 cpu and is still open.
CPU_FLAG_LIST += ERRATA_X4_3701758 CPU_FLAG_LIST += ERRATA_X4_3701758
# Flag to apply erratum 3701747 workaround during context save/restore of
# ICH_VMCR_EL2 reg. This erratum applies to revisions r0p0, r0p1 of the
# Cortex-X925 cpu and is still open.
CPU_FLAG_LIST += ERRATA_X925_3701747
# Flag to apply erratum 1922240 workaround during reset. This erratum applies # Flag to apply erratum 1922240 workaround during reset. This erratum applies
# to revision r0p0 of the Cortex-A510 cpu and is fixed in r0p1. # to revision r0p0 of the Cortex-A510 cpu and is fixed in r0p1.
CPU_FLAG_LIST += ERRATA_A510_1922240 CPU_FLAG_LIST += ERRATA_A510_1922240

View file

@ -18,6 +18,7 @@
#include <cortex_x2.h> #include <cortex_x2.h>
#include <cortex_x3.h> #include <cortex_x3.h>
#include <cortex_x4.h> #include <cortex_x4.h>
#include <cortex_x925.h>
#include <lib/cpus/cpu_ops.h> #include <lib/cpus/cpu_ops.h>
#include <lib/cpus/errata.h> #include <lib/cpus/errata.h>
@ -107,6 +108,12 @@ bool errata_ich_vmcr_el2_applies(void)
break; break;
#endif /* ERRATA_X4_3701758 */ #endif /* ERRATA_X4_3701758 */
#if ERRATA_X925_3701747
case EXTRACT_PARTNUM(CORTEX_X925_MIDR):
if (check_erratum_cortex_x925_3701747(cpu_get_rev_var()) == ERRATA_APPLIES)
return true;
break;
#endif /* ERRATA_X925_3701747 */
default: default:
break; break;
} }