arm-trusted-firmware/common
Jayanth Dodderi Chidanand 6a0da73647 refactor(el3-runtime): add arch-features detection mechanism
This patch adds architectural features detection procedure to ensure
features enabled are present in the given hardware implementation.

It verifies whether the architecture build flags passed during
compilation match the respective features by reading their ID
registers. It reads through all the enabled feature specific ID
registers at once and panics in case of mismatch(feature enabled
but not implemented in PE).

Feature flags are used at sections (context_management,
save and restore routines of registers) during context switch.
If the enabled feature flag is not supported by the PE, it causes an
exception while saving or restoring the registers guarded by them.

With this mechanism, the build flags are validated at an early
phase prior to their usage, thereby preventing any undefined action
under their control.

This implementation is based on tristate approach for each feature and
currently FEAT_STATE=0 and FEAT_STATE=1 are covered as part of this
patch. FEAT_STATE=2 is planned for phase-2 implementation and will be
taken care separately.

The patch has been explicitly tested, by adding a new test_config
with build config enabling majority of the features and detected
all of them under FVP launched with parameters enabling v8.7 features.

Note: This is an experimental procedure and the mechanism itself is
      guarded by a macro "FEATURE_DETECTION", which is currently being
      disabled by default.

The "FEATURE_DETECTION" macro is documented and the platforms are
encouraged to make use of this diagnostic tool by enabling this
"FEATURE_DETECTION" flag explicitly and get used to its behaviour
during booting before the procedure gets mandated.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: Ia23d95430fe82d417a938b672bfb5edc401b0f43
2022-04-04 10:24:51 +01:00
..
aarch32 Align AARCH32 version of debug.S with AARCH64 2020-09-21 17:53:42 +02:00
aarch64 Print newline after hex address in aarch64 el3_panic function 2021-03-04 11:05:31 +01:00
backtrace Don't return error information from console_flush 2020-10-09 10:21:50 -05:00
bl_common.c refactor(measured-boot): avoid Measured-Boot dependency on Trusted-Boot 2022-01-11 23:06:22 +00:00
desc_image_load.c SPMD: extract SPMC DTB header size from SPMD 2020-05-13 08:08:39 +02:00
fdt_fixup.c feat(libfdt): also allow changing base address 2021-11-04 15:58:34 +00:00
fdt_wrappers.c Merge "fix: libc: use long for 64-bit types on aarch64" into integration 2021-11-08 21:34:42 +01:00
fdt_wrappers.mk build(fdt-wrappers): introduce FDT wrappers makefile 2021-10-26 12:14:28 +01:00
feat_detect.c refactor(el3-runtime): add arch-features detection mechanism 2022-04-04 10:24:51 +01:00
image_decompress.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
runtime_svc.c Remove support for the SMC Calling Convention 2.0 2019-01-30 16:01:49 +00:00
tf_crc32.c refactor(hw_crc32): renamed hw_crc32 to tf_crc32 2021-08-02 17:15:41 +01:00
tf_log.c feat(common/debug): add new macro ERROR_NL() to print just a newline 2021-07-21 00:01:06 +02:00
uuid.c fix(fdt): fix OOB write in uuid parsing function 2021-07-26 16:42:25 +01:00