diff --git a/include/lib/cpus/aarch64/cpu_macros.S b/include/lib/cpus/aarch64/cpu_macros.S index ab6041289..ac26fd74b 100644 --- a/include/lib/cpus/aarch64/cpu_macros.S +++ b/include/lib/cpus/aarch64/cpu_macros.S @@ -463,7 +463,7 @@ * clobbers: x0-x10 (PCS compliant) */ .macro apply_erratum _cpu:req, _cve:req, _id:req, _chosen:req, _get_rev=GET_CPU_REV - .if (\_chosen & \_get_rev) + .if (\_chosen && \_get_rev) mov x9, x30 bl cpu_get_rev_var mov x10, x0 diff --git a/lib/cpus/aarch64/cortex_a710.S b/lib/cpus/aarch64/cortex_a710.S index 830771aa7..fef240c1c 100644 --- a/lib/cpus/aarch64/cortex_a710.S +++ b/lib/cpus/aarch64/cortex_a710.S @@ -162,6 +162,7 @@ workaround_reset_end cortex_a710, ERRATUM(2282622) check_erratum_ls cortex_a710, ERRATUM(2282622), CPU_REV(2, 1) +.global erratum_cortex_a710_2291219_wa workaround_runtime_start cortex_a710, ERRATUM(2291219), ERRATA_A710_2291219 /* Set/unset bit 36 in ACTLR2_EL1. The first call will set it, applying * the workaround. Second call clears it to undo it. */ diff --git a/lib/cpus/aarch64/cortex_x3.S b/lib/cpus/aarch64/cortex_x3.S index 7a339b489..7c6af8cb4 100644 --- a/lib/cpus/aarch64/cortex_x3.S +++ b/lib/cpus/aarch64/cortex_x3.S @@ -52,6 +52,7 @@ workaround_runtime_end cortex_x3, ERRATUM(2302506), NO_ISB check_erratum_ls cortex_x3, ERRATUM(2302506), CPU_REV(1, 1) +.global erratum_cortex_x3_2313909_wa workaround_runtime_start cortex_x3, ERRATUM(2313909), ERRATA_X3_2313909 /* Set/unset bit 36 in ACTLR2_EL1. The first call will set it, applying * the workaround. Second call clears it to undo it. */ diff --git a/lib/cpus/aarch64/neoverse_n2.S b/lib/cpus/aarch64/neoverse_n2.S index 5cccff311..b9818cd64 100644 --- a/lib/cpus/aarch64/neoverse_n2.S +++ b/lib/cpus/aarch64/neoverse_n2.S @@ -165,6 +165,7 @@ workaround_reset_end neoverse_n2, ERRATUM(2280757) check_erratum_ls neoverse_n2, ERRATUM(2280757), CPU_REV(0, 0) +.global erratum_neoverse_n2_2326639_wa workaround_runtime_start neoverse_n2, ERRATUM(2326639), ERRATA_N2_2326639 /* Set/unset bit 36 in ACTLR2_EL1. The first call will set it, applying * the workaround. Second call clears it to undo it. */ diff --git a/lib/psci/aarch64/psci_helpers.S b/lib/psci/aarch64/psci_helpers.S index cca08c132..088ab43f4 100644 --- a/lib/psci/aarch64/psci_helpers.S +++ b/lib/psci/aarch64/psci_helpers.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2014-2025, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -131,4 +131,12 @@ func psci_power_down_wfi 1: wfi b 1b + + /* + * in case the WFI wasn't terminal, we have to undo errata mitigations. + * These will be smart enough to handle being called the same way + */ + apply_erratum cortex_a710, ERRATUM(2291219), ERRATA_A710_2291219 + apply_erratum cortex_x3, ERRATUM(2313909), ERRATA_X3_2313909, NO_GET_CPU_REV + apply_erratum neoverse_n2, ERRATUM(2326639), ERRATA_N2_2326639, NO_GET_CPU_REV endfunc psci_power_down_wfi