arm-trusted-firmware/include/services
Boyan Karatotev 8db170524d feat(smccc): implement SMCCC_ARCH_FEATURE_AVAILABILITY
SMCCC_ARCH_FEATURE_AVAILABILITY [1] is a call to query firmware about
the features it is aware of and enables. This is useful when a feature
is not enabled at EL3, eg due to an older FW image, but it is present in
hardware. In those cases, the EL1 ID registers do not reflect the usable
feature set and this call should provide the necessary information to
remedy that.

The call itself is very lightweight - effectively a sanitised read of
the relevant system register. Bits that are not relevant to feature
enablement are masked out and active low bits are converted to active
high.

The implementation is also very simple. All relevant, irrelevant, and
inverted bits combined into bitmasks at build time. Then at runtime the
masks are unconditionally applied to produce the right result. This
assumes that context managers will make sure that disabled features
do not have their bits set and the registers are context switched if
any fields in them make enablement ambiguous.

Features that are not yet supported in TF-A have not been added. On
debug builds, calling this function will fail an assert if any bits that
are not expected are set. In combination with CI this should allow for
this feature to to stay up to date as new architectural features are
added.

If a call for MPAM3_EL3 is made when MPAM is not enabled, the call
will return INVALID_PARAM, while if it is FEAT_STATE_CHECK, it will
return zero. This should be fairly consistent with feature detection.

The bitmask is meant to be interpreted as the logical AND of the
relevant ID registers. It would be permissible for this to return 1
while the ID returns 0. Despite this, this implementation takes steps
not to. In the general case, the two should match exactly.

Finally, it is not entirely clear whether this call replies to SMC32
requests. However, it will not, as the return values are all 64 bits.

[1]: https://developer.arm.com/documentation/den0028/galp1/?lang=en

Co-developed-by: Charlie Bareham <charlie.bareham@arm.com>
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I1a74e7d0b3459b1396961b8fa27f84e3f0ad6a6f
2025-01-07 08:00:11 +00:00
..
oem/chromeos feat(cros_widevine): add ChromeOS widevine SMC handler 2024-02-02 16:41:21 +08:00
trp feat(rme): set DRAM information in Boot Manifest platform data 2023-01-17 16:35:41 +00:00
arm_arch_svc.h feat(smccc): implement SMCCC_ARCH_FEATURE_AVAILABILITY 2025-01-07 08:00:11 +00:00
drtm_svc.h feat(drtm): update DRTM version to 1.0 2024-03-05 14:24:13 -06:00
el3_spmc_ffa_memory.h fix(el3-spmc): validate descriptor headers 2023-05-03 10:39:53 -04:00
el3_spmc_logical_sp.h chore: remove unused and undefined function 2023-06-06 08:19:06 -07:00
el3_spmd_logical_sp.h fix(spmd): coverity scan issues 2023-09-25 13:06:13 -07:00
errata_abi_svc.h feat(errata_abi): errata management firmware interface 2023-05-05 13:23:10 -05:00
ffa_svc.h feat(spmd): add FFA_MSG_SEND_DIR_RESP2 2024-01-18 14:44:50 -05:00
pci_svc.h SMCCC/PCI: Add initial PCI conduit definitions 2021-05-25 14:49:01 +02:00
rmm_core_manifest.h fix(rme): add console name to checksum calculation 2024-11-15 15:59:00 +02:00
rmm_el3_token_sign.h feat(rmmd): el3 token sign during attestation 2024-10-15 08:20:28 -07:00
rmmd_svc.h feat(rmmd): el3 token sign during attestation 2024-10-15 08:20:28 -07:00
sdei.h feat(sdei): add a function to return total number of events registered 2022-10-05 15:25:28 +01:00
sdei_flags.h plat/arm/fvp: Support performing SDEI platform setup in runtime 2020-05-15 10:05:06 -05:00
spm_core_manifest.h SPMC: manifest changes to support multicore boot 2020-08-20 18:06:06 +01:00
spm_mm_partition.h spm-mm: Refactor secure_partition.h and its contents 2019-12-20 16:03:41 +00:00
spm_mm_svc.h spm-mm: Remove mm_svc.h header 2019-12-20 16:04:01 +00:00
spmc_svc.h feat(spmd): update SPMC init flow to use EL3 implementation 2022-04-20 18:29:32 +01:00
spmd_svc.h feat(spmd): pass SMCCCv1.3 SVE hint to lower EL 2024-02-07 17:46:01 +01:00
std_svc.h Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
trng_svc.h refactor(trng): cleanup the existing TRNG support 2022-11-08 13:48:18 +00:00
ven_el3_svc.h refactor(smccc): move pmf to vendor el3 calls 2024-05-06 09:42:11 -05:00