Browse Source

fix(cpus): workaround for Cortex-A720 erratum 2926083

Cortex-A720 erratum 2926083 is a Cat B erratum that is present
in revisions r0p0, r0p1 and is fixed in r0p2. The errata is only
present when SPE (Statistical Profiling Extension) is implemented
and enabled.

The workaround is to set bits[58:57] of the CPUACTLR_EL1 to 'b11
when SPE is "implemented and enabled".

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

Change-Id: I30182c3893416af65b55fca9a913cb4512430434
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
pull/2000/merge
Bipin Ravi 8 months ago
committed by Govindraj Raja
parent
commit
152f4cfa16
  1. 4
      docs/design/cpu-specific-build-macros.rst
  2. 5
      include/lib/cpus/aarch64/cortex_a720.h
  3. 16
      lib/cpus/aarch64/cortex_a720.S
  4. 4
      lib/cpus/cpu-ops.mk
  5. 1
      plat/arm/board/fvp/platform.mk

4
docs/design/cpu-specific-build-macros.rst

@ -918,6 +918,10 @@ For Cortex-A715, the following errata build flags are defined :
For Cortex-A720, the following errata build flags are defined : For Cortex-A720, the following errata build flags are defined :
- ``ERRATA_A720_2926083``: This applies errata 2926083 workaround to
Cortex-A720 CPU. This needs to be enabled for revisions r0p0 and r0p1.
It is fixed in r0p2.
- ``ERRATA_A720_2940794``: This applies errata 2940794 workaround to - ``ERRATA_A720_2940794``: This applies errata 2940794 workaround to
Cortex-A720 CPU. This needs to be enabled for revisions r0p0 and r0p1. Cortex-A720 CPU. This needs to be enabled for revisions r0p0 and r0p1.
It is fixed in r0p2. It is fixed in r0p2.

5
include/lib/cpus/aarch64/cortex_a720.h

@ -12,6 +12,11 @@
/* Cortex A720 loop count for CVE-2022-23960 mitigation */ /* Cortex A720 loop count for CVE-2022-23960 mitigation */
#define CORTEX_A720_BHB_LOOP_COUNT U(132) #define CORTEX_A720_BHB_LOOP_COUNT U(132)
/*******************************************************************************
* CPU Auxiliary Control register 1 specific definitions.
******************************************************************************/
#define CORTEX_A720_CPUACTLR_EL1 S3_0_C15_C1_0
/******************************************************************************* /*******************************************************************************
* CPU Auxiliary Control register 2 specific definitions. * CPU Auxiliary Control register 2 specific definitions.
******************************************************************************/ ******************************************************************************/

16
lib/cpus/aarch64/cortex_a720.S

@ -26,6 +26,22 @@
wa_cve_2022_23960_bhb_vector_table CORTEX_A720_BHB_LOOP_COUNT, cortex_a720 wa_cve_2022_23960_bhb_vector_table CORTEX_A720_BHB_LOOP_COUNT, cortex_a720
#endif /* WORKAROUND_CVE_2022_23960 */ #endif /* WORKAROUND_CVE_2022_23960 */
workaround_reset_start cortex_a720, ERRATUM(2926083), ERRATA_A720_2926083
/* Erratum 2926083 workaround is required only if SPE is enabled */
#if ENABLE_SPE_FOR_NS != 0
/* Check if Static profiling extension is implemented or present. */
mrs x1, id_aa64dfr0_el1
ubfx x0, x1, ID_AA64DFR0_PMS_SHIFT, #4
cbz x0, 1f
/* Apply the workaround by setting CPUACTLR_EL1[58:57] = 0b11. */
sysreg_bit_set CORTEX_A720_CPUACTLR_EL1, BIT(57)
sysreg_bit_set CORTEX_A720_CPUACTLR_EL1, BIT(58)
1:
#endif
workaround_reset_end cortex_a720, ERRATUM(2926083)
check_erratum_ls cortex_a720, ERRATUM(2926083), CPU_REV(0, 1)
workaround_reset_start cortex_a720, ERRATUM(2940794), ERRATA_A720_2940794 workaround_reset_start cortex_a720, ERRATUM(2940794), ERRATA_A720_2940794
sysreg_bit_set CORTEX_A720_CPUACTLR2_EL1, BIT(37) sysreg_bit_set CORTEX_A720_CPUACTLR2_EL1, BIT(37)
workaround_reset_end cortex_a720, ERRATUM(2940794) workaround_reset_end cortex_a720, ERRATUM(2940794)

4
lib/cpus/cpu-ops.mk

@ -940,6 +940,10 @@ CPU_FLAG_LIST += ERRATA_A715_2429384
# only to revision r1p0. It is fixed in r1p1. # only to revision r1p0. It is fixed in r1p1.
CPU_FLAG_LIST += ERRATA_A715_2561034 CPU_FLAG_LIST += ERRATA_A715_2561034
# Flag to apply erratum 2926083 workaround during reset. This erratum applies
# to revisions r0p0 and r0p1. It is fixed in r0p2.
CPU_FLAG_LIST += ERRATA_A720_2926083
# Flag to apply erratum 2940794 workaround during reset. This erratum applies # Flag to apply erratum 2940794 workaround during reset. This erratum applies
# to revisions r0p0 and r0p1. It is fixed in r0p2. # to revisions r0p0 and r0p1. It is fixed in r0p2.
CPU_FLAG_LIST += ERRATA_A720_2940794 CPU_FLAG_LIST += ERRATA_A720_2940794

1
plat/arm/board/fvp/platform.mk

@ -205,6 +205,7 @@ else
lib/cpus/aarch64/cortex_a78c.S \ lib/cpus/aarch64/cortex_a78c.S \
lib/cpus/aarch64/cortex_a710.S \ lib/cpus/aarch64/cortex_a710.S \
lib/cpus/aarch64/cortex_a715.S \ lib/cpus/aarch64/cortex_a715.S \
lib/cpus/aarch64/cortex_a720.S \
lib/cpus/aarch64/neoverse_n_common.S \ lib/cpus/aarch64/neoverse_n_common.S \
lib/cpus/aarch64/neoverse_n1.S \ lib/cpus/aarch64/neoverse_n1.S \
lib/cpus/aarch64/neoverse_n2.S \ lib/cpus/aarch64/neoverse_n2.S \

Loading…
Cancel
Save