]> git.baikalelectronics.ru Git - arm-tf.git/commit
refactor(context-mgmt): move FEAT_FGT save/restore code into C
authorAndre Przywara <andre.przywara@arm.com>
Thu, 10 Nov 2022 14:40:37 +0000 (14:40 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Wed, 11 Jan 2023 16:02:58 +0000 (16:02 +0000)
commitbb7b85a397f4eddef84b2deaa8f3f7a66cb3a09b
tree38ccde196bf37107ab837fc2fa8afe52be9090aa
parentf0deb4c8c7126bf0a2b99629486923b1a0d9dc42
refactor(context-mgmt): move FEAT_FGT save/restore code into C

At the moment we do the EL2 context save/restore sequence in assembly,
where it is just guarded by #ifdef statement for the build time flags.
This does not cover the FEAT_STATE_CHECK case, where we need to check
for the runtime availability of a feature.

To simplify this extension, and to avoid writing too much code in
assembly, move that sequence into C: it is called from C context
anyways.

This protects the C code with the new version of the is_xxx_present()
check, which combines both build time and runtime check, as necessary,
and allows the compiler to optimise the calls aways, if we don't need
them.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I7c91bec60efcc00a43429dc0381f7e1c203be780
include/arch/aarch64/arch_helpers.h
include/lib/el3_runtime/aarch64/context.h
lib/el3_runtime/aarch64/context.S
lib/el3_runtime/aarch64/context_mgmt.c