arm-trusted-firmware/lib
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
..
aarch32 chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
aarch64 feat(gpt): add support for large GPT mappings 2024-05-14 10:36:42 +02:00
bl_aux_params chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
compiler-rt chore(compiler-rt): update compiler-rt source files 2024-05-10 11:24:49 +02:00
coreboot chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
cpus perf(cpus): make reset errata do fewer branches 2025-02-24 09:36:11 +00:00
debugfs chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
el3_runtime perf(cpus): inline the init_cpu_data_ptr function 2025-02-24 09:36:11 +00:00
extensions fix: add support for 128-bit sysregs to EL3 crash handler 2025-02-05 21:19:15 +01:00
fconf feat(fconf): support signing-key in root cert node 2024-01-18 13:18:09 -06:00
gpt_rme feat(gpt): statically allocate bitlocks array 2025-02-11 15:10:49 +00:00
hob feat(lib): introduce Hob creation library 2024-12-06 13:26:31 +00:00
libc feat(libc): import qsort implementation 2025-02-10 15:21:00 +00:00
libfdt build(libfdt): introduce include guards 2024-05-10 11:58:45 +00:00
locks feat(locks): add bitlock 2024-04-15 12:14:16 +01:00
mpmm fix(errata): workaround for Cortex-A510 erratum 2250311 2022-02-24 23:30:41 +02:00
optee chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
pmf feat((smccc): add version FID for PMF 2024-05-06 09:42:11 -05:00
psa feat(psa): add interface with RSE for retrieving entropy 2025-02-04 10:26:02 +00:00
psci chore(docs): drop the "wfi" from pwr_domain_pwr_down_wfi 2025-02-03 14:29:47 +00:00
romlib chore(romlib): remove unused jmptbl.i file 2024-12-05 17:35:57 +00:00
semihosting chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
stack_protector chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
transfer_list fix(handoff): fix message formatting of hex values 2024-12-18 14:48:23 +00:00
utils chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
xlat_mpu refactor(cpufeat): add macro to simplify is_feat_xx_present 2024-05-02 12:16:16 -05:00
xlat_tables feat(d128): add support for FEAT_D128 2024-10-24 14:51:55 -05:00
xlat_tables_v2 feat(d128): add support for FEAT_D128 2024-10-24 14:51:55 -05:00
zlib chore(zlib): update zlib to version 1.3 2023-11-06 21:13:38 +00:00