arm-trusted-firmware/include/lib
Boyan Karatotev 3f4c1e1e7b feat(cpus): add a concise way to implement AArch64 errata
Errata implementation involves adding a lot of boilerplate to random
places with just conventions on how to do them. Copy pasting is the
usual method for doing this. The result is an error-prone and verbose
patch that is a nightmare to get through review.

Errata workarounds have a very large degree of similarity - most of them
involve setting a bit at reset. As such most of the boilerplate is not
strictly necessary. To solve this, add a collection of assembly macros
to wrap errata implementations such that only the actual mitigations
need to be written. A new erratum mitigation looks something like:

  workaround_reset_start cortex_a77, ERRATUM(1925769), ERRATA_A77_1925769
    sysreg_bit_set CORTEX_A77_CPUECTLR_EL1, CORTEX_A77_CPUECTLR_EL1_BIT_8
  workaround_reset_end cortex_a77, ERRATUM(1925769)

  check_erratum_ls cortex_a77, ERRATUM(1925769), CPU_REV(1, 1)

Note, that the long comment on every mitigation is missing. This is on
purpose, as this new format includes all of its contents into an easily
readable format.

The workaround wrappers add an erratum entry (24 bytes) to a per-cpu
data structure which can then be read by a standard reset function to
apply all errata automatically. This has the added benefit of collecting
all errata TF-A knows about in a central way, which was previously
missing. This can then be used at runtime with the errata ABI.

If an erratum doesn't fit this standard definition (eg. the
CVE_2022_23960), it can progressively be unwrapped to the old
convention. The only differences are that the naming format is slightly
more verbose and a call to add_erratum_entry is needed to inform the
framework about the errata.

Finally, the internal workaround names change a tiny bit, especially
CVEs.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Iac644f85dcf85b8279b25e83baf1e7d08b253b16
2023-05-30 09:31:15 +01:00
..
bl_aux_params style(docs): fix typo s/flase/false/ 2023-03-21 13:41:39 +01:00
cpus feat(cpus): add a concise way to implement AArch64 errata 2023-05-30 09:31:15 +01:00
el3_runtime refactor(cpufeat): enable FEAT_RAS for FEAT_STATE_CHECKED 2023-05-09 13:20:01 +01:00
extensions feat(cpufeat): enable FEAT_SVE for FEAT_STATE_CHECKED 2023-03-28 17:19:13 +02:00
fconf feat(fconf): rename 'ns-load-address' to 'secondary-load-address' 2023-02-07 11:26:38 +00:00
gpt_rme fix(gpt_rme): rework delegating/undelegating sequence 2022-03-09 16:08:42 +01:00
libc feat(libc): add support for fallthrough statement 2023-03-20 13:37:36 +00:00
libfdt feat(libfdt): upgrade libfdt source files 2022-10-19 14:07:46 +01:00
mpmm feat(mpmm): add support for MPMM 2021-10-26 12:15:42 +01:00
pmf build: always prefix section names with . 2023-02-20 18:29:33 +00:00
psa feat(psa): interface with RSS for NV counters 2023-02-08 10:33:48 +02:00
psci feat(psci): introduce 'pwr_domain_off_early' hook 2023-04-26 09:53:10 +01:00
xlat_mpu fvp_r: load, auth, and transfer from BL1 to BL33 2021-09-30 17:07:11 +01:00
xlat_tables build: always prefix section names with . 2023-02-20 18:29:33 +00:00
zlib Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
bakery_lock.h build: always prefix section names with . 2023-02-20 18:29:33 +00:00
cassert.h Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
coreboot.h feat(optee): add device tree for coreboot table 2023-05-11 10:46:57 +02:00
debugfs.h debugfs: add SMC channel 2019-12-18 09:59:12 +01:00
mmio.h Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
object_pool.h fconf: Fix misra issues 2020-02-27 16:14:07 +00:00
optee_utils.h feat(optee): add loading OP-TEE image via an SMC 2023-01-31 10:38:16 -08:00
runtime_instr.h Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
semihosting.h qemu: Implement qemu_system_off via semihosting. 2020-01-23 10:53:45 +00:00
smccc.h fix(smccc): check smc_fid [23:17] bits 2023-03-20 10:12:38 +00:00
spinlock.h Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
utils.h arm: gicv3: Fix compiler dependent behavior 2019-12-10 15:53:44 -06:00
utils_def.h fix: add parenthesis for tests in MIN, MAX and CLAMP macros 2022-12-07 14:16:03 +01:00