mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-08 05:43:53 +00:00

SVE and SME aren't enabled symmetrically for all worlds, but EL3 needs to context switch them nonetheless. Previously, this had to happen by writing the enable bits just before reading/writing the relevant context. But since the introduction of root context, this need not be the case. We can have these enables always be present for EL3 and save on some work (and ISBs!) on every context switch. We can also hoist ZCR_EL3 to a never changing register, as we set its value to be identical for every world, which happens to be the one we want for EL3 too. Change-Id: I3d950e72049a298008205ba32f230d5a5c02f8b0 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
38 lines
865 B
C
38 lines
865 B
C
/*
|
|
* Copyright (c) 2017-2025, Arm Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef SVE_H
|
|
#define SVE_H
|
|
|
|
#include <context.h>
|
|
|
|
#if (ENABLE_SME_FOR_NS || ENABLE_SVE_FOR_NS)
|
|
|
|
void sve_init_el3(void);
|
|
void sve_init_el2_unused(void);
|
|
void sve_enable_per_world(per_world_context_t *per_world_ctx);
|
|
void sve_disable_per_world(per_world_context_t *per_world_ctx);
|
|
#else
|
|
static inline void sve_init_el3(void)
|
|
{
|
|
}
|
|
static inline void sve_init_el2_unused(void)
|
|
{
|
|
}
|
|
static inline void sve_enable_per_world(per_world_context_t *per_world_ctx)
|
|
{
|
|
}
|
|
static inline void sve_disable_per_world(per_world_context_t *per_world_ctx)
|
|
{
|
|
}
|
|
#endif /* ( ENABLE_SME_FOR_NS | ENABLE_SVE_FOR_NS ) */
|
|
|
|
#if CTX_INCLUDE_SVE_REGS
|
|
void sve_context_save(simd_regs_t *regs);
|
|
void sve_context_restore(simd_regs_t *regs);
|
|
#endif
|
|
|
|
#endif /* SVE_H */
|