arm-trusted-firmware/docs/components
Boyan Karatotev 83ec7e452c perf(amu): greatly simplify AMU context management
The current code is incredibly resilient to updates to the spec and
has worked quite well so far. However, recent implementations expose a
weakness in that this is rather slow. A large part of it is written in
assembly, making it opaque to the compiler for optimisations. The
future proofness requires reading registers that are effectively
`volatile`, making it even harder for the compiler, as well as adding
lots of implicit barriers, making it hard for the microarchitecutre to
optimise as well.

We can make a few assumptions, checked by a few well placed asserts, and
remove a lot of this burden. For a start, at the moment there are 4
group 0 counters with static assignments. Contexting them is a trivial
affair that doesn't need a loop. Similarly, there can only be up to 16
group 1 counters. Contexting them is a bit harder, but we can do with a
single branch with a falling through switch. If/when both of these
change, we have a pair of asserts and the feature detection mechanism to
guard us against pretending that we support something we don't.

We can drop contexting of the offset registers. They are fully
accessible by EL2 and as such are its responsibility to preserve on
powerdown.

Another small thing we can do, is pass the core_pos into the hook.
The caller already knows which core we're running on, we don't need to
call this non-trivial function again.

Finally, knowing this, we don't really need the auxiliary AMUs to be
described by the device tree. Linux doesn't care at the moment, and any
information we need for EL3 can be neatly placed in a simple array.

All of this, combined with lifting the actual saving out of assembly,
reduces the instructions to save the context from 180 to 40, including a
lot fewer branches. The code is also much shorter and easier to read.

Also propagate to aarch32 so that the two don't diverge too much.

Change-Id: Ib62e6e9ba5be7fb9fb8965c8eee148d5598a5361
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-25 08:50:46 +00:00
..
fconf perf(amu): greatly simplify AMU context management 2025-02-25 08:50:46 +00:00
measured_boot feat(fvp): add Event Log maximum size property in DT 2023-04-18 17:13:17 +02:00
spd feat(optee): add loading OP-TEE image via an SMC 2023-01-31 10:38:16 -08:00
activity-monitors.rst perf(amu): greatly simplify AMU context management 2025-02-25 08:50:46 +00:00
arm-sip-service.rst refactor(docs): added versioning to smccc services 2024-05-06 09:42:11 -05:00
context-management-library.rst docs(context-mgmt): add Root-Context documentation 2024-11-15 10:44:39 +00:00
cot-binding.rst docs: fix typos in cot binding 2024-08-29 17:31:35 +01:00
debugfs-design.rst Fix broken links to various sections across docs 2020-08-03 09:55:04 -05:00
el3-spmc.rst docs(spm): add design documentation 2022-10-27 11:39:53 +01:00
exception-handling.rst Fix broken links in docs 2020-08-06 12:36:17 -05:00
ffa-manifest-binding.rst docs: fix ff-a manifest binding document 2024-09-18 15:10:13 -05:00
firmware-update.rst feat(fwu): update the URL links for the FWU specification 2024-03-01 14:19:56 +05:30
granule-protection-tables-design.rst feat(gpt): statically allocate bitlocks array 2025-02-11 15:10:49 +00:00
index.rst docs(context-mgmt): add documentation for context management library 2024-05-07 17:52:14 +01:00
mpmm.rst perf(mpmm): greatly simplify MPMM enablement 2025-02-25 08:50:45 +00:00
platform-interrupt-controller-API.rst fix(gic600): workaround for Part 1 of GIC600 erratum 2384374 2024-03-06 14:16:35 -06:00
ras.rst docs(ras): update RAS documentation 2023-11-01 17:46:47 +00:00
realm-management-extension.rst docs: change FVP argument in RME configuration 2024-02-06 11:00:54 +00:00
rmm-el3-comms-spec.rst feat(rmm): add PCIe IO info to Boot manifest 2025-02-11 15:10:49 +00:00
romlib-design.rst fix(romlib): wrap indirectly included functions 2024-08-15 10:49:07 -05:00
sdei.rst docs(sdei): provide security guidelines when using SDEI 2024-02-15 15:37:00 +00:00
secure-partition-manager-mm.rst docs(spm-mm): remove reference to SEL2 SPMC 2023-10-31 11:19:41 +01:00
secure-partition-manager.rst fix(mte): remove deprecated CTX_INCLUDE_MTE_REGS/FEAT_MTE 2024-10-24 10:00:19 -05:00
ven-el3-debugfs.rst refactor(smccc): move debugfs to vendor el3 calls 2024-05-06 09:42:11 -05:00
ven-el3-service.rst refactor(docs): added versioning to smccc services 2024-05-06 09:42:11 -05:00
xlat-tables-lib-v2-design.rst chore: fvp_r: Initial No-EL3 and MPU Implementation 2021-09-30 17:05:59 +01:00