feat(cpufeat): enable FEAT_SVE for FEAT_STATE_CHECKED

Add support for runtime detection (ENABLE_SVE_FOR_NS=2), by splitting
sve_supported() into an ID register reading function and a
second function to report the support status. That function considers
both build time settings and runtime information (if needed), and is
used before we do SVE specific setup.

Change the FVP platform default to the now supported dynamic
option (=2), so the right decision can be made by the code at runtime.

Change-Id: I1caaba2216e8e2a651452254944a003607503216
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
This commit is contained in:
Jayanth Dodderi Chidanand 2023-03-07 10:43:19 +00:00 committed by Manish V Badarkhe
parent 45007acd46
commit 2b0bc4e028
12 changed files with 76 additions and 86 deletions

View file

@ -20,13 +20,6 @@ void sme_enable(cpu_context_t *context)
u_register_t cptr_el3;
el3_state_t *state;
/* Make sure SME is implemented in hardware before continuing. */
if (!is_feat_sme_supported()) {
/* Perhaps the hardware supports SVE only */
sve_enable(context);
return;
}
/* Get the context state. */
state = get_el3state_ctx(context);
@ -70,13 +63,6 @@ void sme_disable(cpu_context_t *context)
u_register_t reg;
el3_state_t *state;
/* Make sure SME is implemented in hardware before continuing. */
if (!is_feat_sme_supported()) {
/* Perhaps the hardware supports SVE only */
sve_disable(context);
return;
}
/* Get the context state. */
state = get_el3state_ctx(context);