arm-trusted-firmware/include/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
..
bl_aux_params 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
dice feat(dice): add typedefs from the Open DICE repo 2024-03-06 15:44:55 +01:00
el3_runtime perf(cpus): inline the init_cpu_data_ptr function 2025-02-24 09:36:11 +00:00
extensions fix(spe): add a psb before updating context and remove context saving 2024-12-16 15:14:30 +00:00
fconf chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01: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 fix(libc): remove __Nonnull type specifier 2025-02-16 23:05:07 +00:00
libfdt chore(libfdt): update header files to v1.7.0 tag 2023-11-06 21:13:22 +00:00
mpmm feat(mpmm): add support for MPMM 2021-10-26 12:15:42 +01:00
pmf fix(smc): correctly find pmf version 2024-05-08 20:36:04 -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
xlat_mpu chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
xlat_tables fix(xlat): correct attribute retrieval in a RME enabled system 2024-07-22 14:14:33 +02:00
zlib chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
bakery_lock.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
bootmarker_capture.h feat(fvp): capture timestamps in bl stages 2023-09-07 23:38:43 +02:00
cassert.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
coreboot.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
debugfs.h fix(smc): correctly find pmf version 2024-05-08 20:36:04 -05:00
mmio.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
object_pool.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
optee_utils.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
runtime_instr.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
semihosting.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
smccc.h feat(smccc): add vendor specific el3 id 2024-05-06 09:42:11 -05:00
spinlock.h feat(locks): add bitlock 2024-04-15 12:14:16 +01:00
transfer_list.h feat(handoff): transfer entry ID for TPM event log 2025-01-06 07:18:39 -08:00
utils.h chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
utils_def.h refactor(lib): rename GENMASK parameters 2024-06-26 20:54:47 +03:00