| ed804406 | 11-Nov-2022 |
Rohit Mathew <rohit.mathew@arm.com> |
fix(mpam): run-time checks for mpam save/restore routines
With "ENABLE_MPAM_FOR_LOWER_ELS" and "CTX_INCLUDE_EL2_REGS" build options enabled, MPAM EL2 registers would be saved/restored as part of con
fix(mpam): run-time checks for mpam save/restore routines
With "ENABLE_MPAM_FOR_LOWER_ELS" and "CTX_INCLUDE_EL2_REGS" build options enabled, MPAM EL2 registers would be saved/restored as part of context management. Context save/restore routines as of now would proceed to access all of MPAM EL2 registers without any runtime checks. MPAM specification states that MPAMHCR_EL2 should only be accessed if MPAMIDR_EL1.HAS_HCR is "1". Likewise, MPAMIDR_EL1.VPMR_MAX has to be probed to obtain the maximum supported MPAMVPM<x>_EL2 before accessing corresponding MPAMVPM<x>_EL2 registers. Since runtime checks are not being made, an exception would be raised if the platform under test doesn't support one of the registers. On Neoverse reference design platforms, an exception is being raised while MPAMVPM2_EL2 or above are accessed. Neoverse reference design platforms support only registers till MPAMVPM1_EL2 at this point.
To resolve this, add sufficient runtime checks in MPAM EL2 context save/restore routines. As part of the new save/restore routines, MPAMIDR_EL1.HAS_HCR and MPAMIDR_EL1.VPMR_MAX are probed for the right set of registers to be saved and restored.
CC: Davidson Kumaresan <davidson.kumaresan@arm.com> Signed-off-by: Rohit Mathew <rohit.mathew@arm.com> Change-Id: I2e3affd23091023b287b2bd5057a4a549037b611
show more ...
|
| c5a3ebbd | 15-Nov-2022 |
Andre Przywara <andre.przywara@arm.com> |
refactor(context-mgmt): move FEAT_HCX save/restore into C
At the moment we save and restore the HCRX_EL2 register in assembly, and just depend on the build time flags. To allow runtime checking, and
refactor(context-mgmt): move FEAT_HCX save/restore into C
At the moment we save and restore the HCRX_EL2 register in assembly, and just depend on the build time flags. To allow runtime checking, and to avoid too much code in assembly, move that over to C, and use the new combined build/runtime feature check.
This also allows to drop the assert, since this should now be covered by the different FEAT_STATE_x options.
Change-Id: I3e20b9ba17121d423cd08edc20bbf4e7ae7c0178 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| bb7b85a3 | 10-Nov-2022 |
Andre Przywara <andre.przywara@arm.com> |
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
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
show more ...
|