arm-trusted-firmware/include/lib/cpus/aarch64
Boyan Karatotev 89dba82dfa perf(cpus): make reset errata do fewer branches
Errata application is painful for performance. For a start, it's done
when the core has just come out of reset, which means branch predictors
and caches will be empty so a branch to a workaround function must be
fetched from memory and that round trip is very slow. Then it also runs
with the I-cache off, which means that the loop to iterate over the
workarounds must also be fetched from memory on each iteration.

We can remove both branches. First, we can simply apply every erratum
directly instead of defining a workaround function and jumping to it.
Currently, no errata that need to be applied at both reset and runtime,
with the same workaround function, exist. If the need arose in future,
this should be achievable with a reset + runtime wrapper combo.

Then, we can construct a function that applies each erratum linearly
instead of looping over the list. If this function is part of the reset
function, then the only "far" branches at reset will be for the checker
functions. Importantly, this mitigates the slowdown even when an erratum
is disabled.

The result is ~50% speedup on N1SDP and ~20% on AArch64 Juno on wakeup
from PSCI calls that end in powerdown. This is roughly back to the
baseline of v2.9, before the errata framework regressed on performance
(or a little better). It is important to note that there are other
slowdowns since then that remain unknown.

Change-Id: Ie4d5288a331b11fd648e5c4a0b652b74160b07b9
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-24 09:36:11 +00:00
..
a64fx.h feat(cpus): add a64fx cpu to tf-a 2022-07-07 07:17:25 +09:00
aem_generic.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a35.h feat(cpufeat): add cortex-a35 l2 extended control register 2024-01-26 11:00:43 +08:00
cortex_a53.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a55.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a57.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a65.h
cortex_a65ae.h
cortex_a72.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a73.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a75.h fix(cpus): modify the fix for Cortex-A75 erratum 764081 2024-10-03 10:07:47 -05:00
cortex_a76.h refactor(cpus): convert the Cortex-A76 to use the errata framework 2023-08-03 14:10:28 -05:00
cortex_a76ae.h fix(security): workaround for CVE-2022-23960 for A76AE, A78AE, A78C 2022-03-21 08:57:09 -05:00
cortex_a77.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a78.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a78_ae.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cortex_a78c.h fix(cpus): workaround for Cortex-A78C erratum 2743232 2023-11-20 16:44:28 -06:00
cortex_a510.h refactor(cpus): convert the Cortex-A510 to use cpu helpers 2023-07-27 09:35:12 +01:00
cortex_a520.h feat(cpus): workaround for Cortex-A520(2938996) and Cortex-X4(2726228) 2024-08-17 09:37:55 +01:00
cortex_a710.h fix(cpus): workaround for Cortex-A710 erratum 3701772 2025-02-03 10:14:33 -06:00
cortex_a715.h fix(cpus): workaround for Cortex-A715 erratum 3699560 2025-02-03 10:14:33 -06:00
cortex_a720.h fix(cpus): workaround for Cortex-A720 erratum 3699561 2025-02-03 13:57:26 -06:00
cortex_a720_ae.h fix(cpus): workaround for Cortex-A720-AE erratum 3699562 2025-02-03 13:57:50 -06:00
cortex_a725.h fix(cpus): workaround for Cortex-A725 erratum 3699564 2025-02-03 13:57:50 -06:00
cortex_alto.h fix(cpus): avoid SME related loss of context on powerdown 2025-02-03 14:29:47 +00:00
cortex_arcadia.h feat(cpus): add support for arcadia cpu 2024-10-17 09:34:03 -05:00
cortex_gelas.h Merge changes I765a7fa0,Ic33f0b6d,I8d1a88c7,I381f96be,I698fa849, ... into integration 2025-02-11 16:52:18 +01:00
cortex_x1.h fix(security): workaround for CVE-2022-23960 for Cortex-X1 2022-05-11 15:24:37 +02:00
cortex_x2.h fix(cpus): workaround for Cortex-X2 erratum 3701772 2025-02-03 13:57:50 -06:00
cortex_x3.h fix(cpus): workaround for Cortex-X3 erratum 3701769 2025-02-03 13:57:50 -06:00
cortex_x4.h fix(cpus): workaround for Cortex-X4 erratum 3701758 2025-02-03 13:57:50 -06:00
cortex_x925.h fix(cpus): workaround for Cortex-X925 erratum 3701747 2025-02-03 13:57:50 -06:00
cpu_macros.S perf(cpus): make reset errata do fewer branches 2025-02-24 09:36:11 +00:00
cpuamu.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
denver.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
dsu_def.h refactor(cpus): register DSU errata with the errata framework's wrappers 2025-02-20 17:28:17 +00:00
dsu_macros.S refactor(cpus): register DSU errata with the errata framework's wrappers 2025-02-20 17:28:17 +00:00
generic.h fix(tree): correct some typos 2023-05-09 15:57:12 +01:00
neoverse_e1.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
neoverse_n1.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
neoverse_n2.h fix(cpus): workaround for Neoverse-N2 erratum 3701773 2025-02-03 13:57:50 -06:00
neoverse_n3.h fix(cpus): workaround for Neoverse-N3 erratum 3699563 2025-02-03 13:57:50 -06:00
neoverse_v1.h fix(cpus): workaround for Neoverse V1 erratum 2348377 2023-11-20 16:29:40 -06:00
neoverse_v2.h fix(security): add CVE-2024-7881 mitigation to Neoverse-V2 2025-01-30 16:45:35 -06:00
neoverse_v3.h fix(cpus): workaround for Neoverse-V3 erratum 3701767 2025-02-03 13:57:51 -06:00
nevis.h feat(cpus): add support for Nevis CPU 2023-08-28 13:18:20 -05:00
qemu_max.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
rainier.h
travis.h fix(cpus): avoid SME related loss of context on powerdown 2025-02-03 14:29:47 +00:00