arm-trusted-firmware/services/std_svc
Boyan Karatotev 79c0c7fac0 refactor(cm): clean up per-world context
In preparation for SMCCC_ARCH_FEATURE_AVAILABILITY, it is useful for
context to be directly related to the underlying system. Currently,
certain bits like SCR_EL3.APK are always set with the understanding that
they will only take effect if the feature is present.

However, that is problematic for SMCCC_ARCH_FEATURE_AVAILABILITY (an
SMCCC call to report which features firmware enables), as simply reading
the enable bit may contradict the ID register, like the APK bit above
for a system with no Pauth present.

This patch is to clean up these cases. Add a check for PAuth's presence
so that the APK bit remains unset if not present. Also move SPE and TRBE
enablement to only the NS context. They already only enable the features
for NS only and disable them for Secure and Realm worlds. This change
only makes these worlds' context read 0 for easy bitmasking.

There's only a single snag on SPE and TRBE. Currently, their fields have
the same values and any world asymmetry is handled by hardware. Since we
don't want to do that, the buffers' ownership will change if we just set
the fields to 0 for non-NS worlds. Doing that, however, exposes Secure
state to a potential denial of service attack - a malicious NS can
enable profiling and call an SMC. Then, the owning security state will
change and since no SPE/TRBE registers are contexted, Secure state will
start generating records. Always have NS world own the buffers to
prevent this.

Finally, get rid of manage_extensions_common() as it's just a level of
indirection to enable a single feature.

Change-Id: I487bd4c70ac3e2105583917a0e5499e0ee248ed9
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-01-07 07:59:28 +00:00
..
drtm fix(drtm): adjust Event Log size in DLME 2024-12-16 09:33:02 +00:00
errata_abi refactor(errata-abi): move EXTRACT_PARTNUM to arch.h 2024-08-17 09:38:31 +01:00
rmmd refactor(cm): clean up per-world context 2025-01-07 07:59:28 +00:00
sdei fix(sdei): fix a crash when attempting to bind more events than are available 2024-08-27 09:11:26 +01:00
spm fix(el3-spmc): use write_el1_ctx_timer() macro to set cntkctl_el1 value 2024-09-20 13:50:16 +01:00
spmd fix(spmd): remove spmd_handle_spmc_message 2024-09-03 20:58:04 +02:00
trng refactor(trng): discarding the used entropy bits 2022-11-14 10:08:56 +00:00
pci_svc.c SMCCC/PCI: Handle std svc boilerplate 2021-05-25 14:49:08 +02:00
std_svc_setup.c fix(std_svc): continue boot if rmmd_setup fails 2024-07-21 11:41:14 +00:00