mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
Merge changes from topic "sm/fix_erratum" into integration
* changes: fix(cpus): workaround for CVE-2024-5660 for Cortex-X925 fix(cpus): workaround for CVE-2024-5660 for Cortex-X2 fix(cpus): workaround for CVE-2024-5660 for Cortex-A77 fix(cpus): workaround for CVE-2024-5660 for Neoverse-V1 fix(cpus): workaround for CVE-2024-5660 for Cortex-A78_AE fix(cpus): workaround for CVE-2024-5660 for Cortex-A78C fix(cpus): workaround for CVE-2024-5660 for Cortex-A78 fix(cpus): workaround for CVE-2024-5660 for Cortex-X1 fix(cpus): workaround for CVE-2024-5660 for Neoverse-N2 fix(cpus): workaround for CVE-2024-5660 for Cortex-A710 fix(cpus): workaround for CVE-2024-5660 for Neoverse-V2 fix(cpus): workaround for CVE-2024-5660 for Cortex-X3 fix(cpus): workaround for CVE-2024-5660 for Neoverse-V3 fix(cpus): workaround for CVE-2024-5660 for Cortex-X4
This commit is contained in:
commit
08bbe24533
16 changed files with 110 additions and 1 deletions
|
@ -33,6 +33,11 @@ vulnerability workarounds should be applied at runtime.
|
|||
This build option should be set to 1 if the target platform contains at
|
||||
least 1 CPU that requires this mitigation. Defaults to 1.
|
||||
|
||||
- ``WORKAROUND_CVE_2024_5660``: Enables mitigation for `CVE-2024-5660`.
|
||||
The fix is to disable hardware page aggregation by setting CPUECTLR_EL1[46]
|
||||
in EL3 FW. This build option should be set to 1 if the target platform contains
|
||||
at least 1 CPU that requires this mitigation. Defaults to 1.
|
||||
|
||||
.. _arm_cpu_macros_errata_workarounds:
|
||||
|
||||
CPU Errata Workarounds
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_A710_BHB_LOOP_COUNT, cortex_a710
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_a710, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_A710_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_a710, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_a710, CVE(2024, 5660), CPU_REV(2, 1)
|
||||
|
||||
workaround_reset_start cortex_a710, ERRATUM(1987031), ERRATA_A710_1987031
|
||||
ldr x0,=0x6
|
||||
msr S3_6_c15_c8_0,x0
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_A77_BHB_LOOP_COUNT, cortex_a77
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_a77, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_A77_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_a77, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_a77, CVE(2024, 5660), CPU_REV(1, 1)
|
||||
|
||||
workaround_reset_start cortex_a77, ERRATUM(1508412), ERRATA_A77_1508412
|
||||
/* move cpu revision in again and compare against r0p0 */
|
||||
mov x0, x7
|
||||
|
|
|
@ -24,6 +24,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_A78_BHB_LOOP_COUNT, cortex_a78
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation.Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_a78, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_A78_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_a78, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_a78, CVE(2024, 5660), CPU_REV(1, 2)
|
||||
|
||||
workaround_reset_start cortex_a78, ERRATUM(1688305), ERRATA_A78_1688305
|
||||
sysreg_bit_set CORTEX_A78_ACTLR2_EL1, CORTEX_A78_ACTLR2_EL1_BIT_1
|
||||
workaround_reset_end cortex_a78, ERRATUM(1688305)
|
||||
|
|
|
@ -22,6 +22,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_A78_AE_BHB_LOOP_COUNT, cortex_a78_ae
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_a78_ae, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_A78_AE_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_a78_ae, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_a78_ae, CVE(2024, 5660), CPU_REV(0, 3)
|
||||
|
||||
workaround_reset_start cortex_a78_ae, ERRATUM(1941500), ERRATA_A78_AE_1941500
|
||||
sysreg_bit_set CORTEX_A78_AE_CPUECTLR_EL1, CORTEX_A78_AE_CPUECTLR_EL1_BIT_8
|
||||
workaround_reset_end cortex_a78_ae, ERRATUM(1941500)
|
||||
|
|
|
@ -21,6 +21,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_A78C_BHB_LOOP_COUNT, cortex_a78c
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_a78c, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_A78C_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_a78c, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_a78c, CVE(2024, 5660), CPU_REV(0, 2)
|
||||
|
||||
workaround_reset_start cortex_a78c, ERRATUM(1827430), ERRATA_A78C_1827430
|
||||
/* Disable allocation of splintered pages in the L2 TLB */
|
||||
sysreg_bit_set CORTEX_A78C_CPUECTLR_EL1, CORTEX_A78C_CPUECTLR_EL1_MM_ASP_EN
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2023, Google LLC. All rights reserved.
|
||||
* Copyright (c) 2022-2024, Google LLC. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -23,6 +23,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_X1_BHB_LOOP_COUNT, cortex_x1
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_x1, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_X1_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_x1, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_x1, CVE(2024, 5660), CPU_REV(1, 2)
|
||||
|
||||
workaround_reset_start cortex_x1, ERRATUM(1688305), ERRATA_X1_1688305
|
||||
sysreg_bit_set CORTEX_X1_ACTLR2_EL1, BIT(1)
|
||||
workaround_reset_end cortex_x1, ERRATUM(1688305)
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_X2_BHB_LOOP_COUNT, cortex_x2
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_x2, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_X2_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_x2, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_x2, CVE(2024, 5660), CPU_REV(2, 1)
|
||||
|
||||
workaround_reset_start cortex_x2, ERRATUM(2002765), ERRATA_X2_2002765
|
||||
ldr x0, =0x6
|
||||
msr S3_6_C15_C8_0, x0 /* CPUPSELR_EL3 */
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table CORTEX_X3_BHB_LOOP_COUNT, cortex_x3
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_x3, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_X3_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_x3, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_x3, CVE(2024, 5660), CPU_REV(1, 2)
|
||||
|
||||
workaround_reset_start cortex_x3, ERRATUM(2070301), ERRATA_X3_2070301
|
||||
sysreg_bitfield_insert CORTEX_X3_CPUECTLR2_EL1, CORTEX_X3_CPUECTLR2_EL1_PF_MODE_CNSRV, \
|
||||
CORTEX_X3_CPUECTLR2_EL1_PF_MODE_LSB, CORTEX_X3_CPUECTLR2_EL1_PF_MODE_WIDTH
|
||||
|
|
|
@ -46,6 +46,13 @@ check_erratum_custom_start cortex_x4, ERRATUM(2726228)
|
|||
ret
|
||||
check_erratum_custom_end cortex_x4, ERRATUM(2726228)
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_x4, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_X4_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_x4, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_x4, CVE(2024, 5660), CPU_REV(0, 2)
|
||||
|
||||
workaround_runtime_start cortex_x4, ERRATUM(2740089), ERRATA_X4_2740089
|
||||
/* dsb before isb of power down sequence */
|
||||
dsb sy
|
||||
|
|
|
@ -21,6 +21,13 @@
|
|||
#error "Cortex-X925 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
|
||||
#endif
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start cortex_x925, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set CORTEX_X925_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end cortex_x925, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls cortex_x925, CVE(2024, 5660), CPU_REV(0, 1)
|
||||
|
||||
cpu_reset_func_start cortex_x925
|
||||
/* Disable speculative loads */
|
||||
msr SSBS, xzr
|
||||
|
|
|
@ -34,6 +34,13 @@
|
|||
.equ erratum_neoverse_n2_2313941_wa, errata_dsu_2313941_wa
|
||||
add_erratum_entry neoverse_n2, ERRATUM(2313941), ERRATA_DSU_2313941, APPLY_AT_RESET
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start neoverse_n2, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set NEOVERSE_N2_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end neoverse_n2, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls neoverse_n2, CVE(2024, 5660), CPU_REV(0, 3)
|
||||
|
||||
workaround_reset_start neoverse_n2, ERRATUM(2002655), ERRATA_N2_2002655
|
||||
/* Apply instruction patching sequence */
|
||||
ldr x0,=0x6
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table NEOVERSE_V1_BHB_LOOP_COUNT, neoverse_v1
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start neoverse_v1, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set NEOVERSE_V1_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end neoverse_v1, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls neoverse_v1, CVE(2024, 5660), CPU_REV(1, 2)
|
||||
|
||||
workaround_reset_start neoverse_v1, ERRATUM(1618635), ERRATA_V1_1618635
|
||||
/* Inserts a DMB SY before and after MRS PAR_EL1 */
|
||||
ldr x0, =0x0
|
||||
|
|
|
@ -22,6 +22,13 @@
|
|||
#error "Neoverse V2 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
|
||||
#endif
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start neoverse_v2, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set NEOVERSE_V2_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end neoverse_v2, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls neoverse_v2, CVE(2024, 5660), CPU_REV(0, 2)
|
||||
|
||||
workaround_reset_start neoverse_v2, ERRATUM(2331132), ERRATA_V2_2331132
|
||||
sysreg_bitfield_insert NEOVERSE_V2_CPUECTLR2_EL1, NEOVERSE_V2_CPUECTLR2_EL1_PF_MODE_CNSRV, \
|
||||
NEOVERSE_V2_CPUECTLR2_EL1_PF_MODE_LSB, NEOVERSE_V2_CPUECTLR2_EL1_PF_MODE_WIDTH
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
wa_cve_2022_23960_bhb_vector_table NEOVERSE_V3_BHB_LOOP_COUNT, neoverse_v3
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
|
||||
workaround_reset_start neoverse_v3, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
|
||||
sysreg_bit_set NEOVERSE_V3_CPUECTLR_EL1, BIT(46)
|
||||
workaround_reset_end neoverse_v3, CVE(2024, 5660)
|
||||
|
||||
check_erratum_ls neoverse_v3, CVE(2024, 5660), CPU_REV(0, 1)
|
||||
|
||||
workaround_reset_start neoverse_v3, CVE(2022,23960), WORKAROUND_CVE_2022_23960
|
||||
#if IMAGE_BL31
|
||||
/*
|
||||
|
|
|
@ -33,6 +33,12 @@ CPU_FLAG_LIST += DYNAMIC_WORKAROUND_CVE_2018_3639
|
|||
WORKAROUND_CVE_2022_23960 ?=1
|
||||
CPU_FLAG_LIST += WORKAROUND_CVE_2022_23960
|
||||
|
||||
# Flag to disable Hardware page aggregation(HPA).
|
||||
# This flag is enabled by default.
|
||||
WORKAROUND_CVE_2024_5660 ?=1
|
||||
CPU_FLAG_LIST += WORKAROUND_CVE_2024_5660
|
||||
|
||||
|
||||
# Flags to indicate internal or external Last level cache
|
||||
# By default internal
|
||||
CPU_FLAG_LIST += NEOVERSE_Nx_EXTERNAL_LLC
|
||||
|
|
Loading…
Add table
Reference in a new issue