mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-21 20:14:29 +00:00
feat(sme): fall back to SVE if SME is not there
Due to their interrelationship in the architecture the SVE and SME features in TF-A are mutually exclusive. This means that a single binary can't be shared between systems with and without SME if the system without SME does support SVE, SVE will not be initialised so lower ELs will run into trouble trying to use it. This unusual behaviour for TF-A which normally gracefully handles situations where features are enabled but not supported on the current hardware. Address this by calling the SVE enable and disable functions if SME is not supported rather than immediately exiting, these perform their own feature checks so if neither SVE nor SME is supported behaviour is unchanged. Signed-off-by: Mark Brown <broonie@kernel.org> Change-Id: I2c606202fa6c040069f44e29d36b5abb48391874
This commit is contained in:
parent
896fd4e2ff
commit
26a3351eda
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
|
* Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,8 @@ void sme_enable(cpu_context_t *context)
|
||||||
|
|
||||||
/* Make sure SME is implemented in hardware before continuing. */
|
/* Make sure SME is implemented in hardware before continuing. */
|
||||||
if (!feat_sme_supported()) {
|
if (!feat_sme_supported()) {
|
||||||
|
/* Perhaps the hardware supports SVE only */
|
||||||
|
sve_enable(context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +85,8 @@ void sme_disable(cpu_context_t *context)
|
||||||
|
|
||||||
/* Make sure SME is implemented in hardware before continuing. */
|
/* Make sure SME is implemented in hardware before continuing. */
|
||||||
if (!feat_sme_supported()) {
|
if (!feat_sme_supported()) {
|
||||||
|
/* Perhaps the hardware supports SVE only */
|
||||||
|
sve_disable(context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue