]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(spe): drop SPE EL2 context switch code
authorAndre Przywara <andre.przywara@arm.com>
Fri, 3 Feb 2023 15:23:59 +0000 (15:23 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 20 Mar 2023 13:37:36 +0000 (13:37 +0000)
At the moment we hardcode the SPE functionality to be available on the
non-secure side only, by setting MDCR_EL3.NSPB accordingly.
This also means that the secure world cannot use SPE, so there is no
need to context switch the PMSCR_EL2 register.

Drop the SPE bits from the EL2 context switch code. If any of the other
EL2 worlds wish to start using SPE, this can be brought back.

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

index 31d8f070cfa46739cc46db84938da3fa526207a6..4cbda36b6a5608399db57ed04990ccc6db2c4244 100644 (file)
@@ -514,10 +514,6 @@ void el1_sysregs_context_restore(el1_sysregs_t *regs);
 #if CTX_INCLUDE_EL2_REGS
 void el2_sysregs_context_save_common(el2_sysregs_t *regs);
 void el2_sysregs_context_restore_common(el2_sysregs_t *regs);
-#if ENABLE_SPE_FOR_LOWER_ELS
-void el2_sysregs_context_save_spe(el2_sysregs_t *regs);
-void el2_sysregs_context_restore_spe(el2_sysregs_t *regs);
-#endif /* ENABLE_SPE_FOR_LOWER_ELS */
 #if CTX_INCLUDE_MTE_REGS
 void el2_sysregs_context_save_mte(el2_sysregs_t *regs);
 void el2_sysregs_context_restore_mte(el2_sysregs_t *regs);
index d43914848d94fa91fac4d95e7f83deb4a020a343..b05833432ec8a25914c7b76c7cef7867f5e8b4a5 100644 (file)
 #if CTX_INCLUDE_EL2_REGS
        .global el2_sysregs_context_save_common
        .global el2_sysregs_context_restore_common
-#if ENABLE_SPE_FOR_LOWER_ELS
-       .global el2_sysregs_context_save_spe
-       .global el2_sysregs_context_restore_spe
-#endif /* ENABLE_SPE_FOR_LOWER_ELS */
 #if CTX_INCLUDE_MTE_REGS
        .global el2_sysregs_context_save_mte
        .global el2_sysregs_context_restore_mte
@@ -220,20 +216,6 @@ func el2_sysregs_context_restore_common
        ret
 endfunc el2_sysregs_context_restore_common
 
-#if ENABLE_SPE_FOR_LOWER_ELS
-func el2_sysregs_context_save_spe
-       mrs     x13, PMSCR_EL2
-       str     x13, [x0, #CTX_PMSCR_EL2]
-       ret
-endfunc el2_sysregs_context_save_spe
-
-func el2_sysregs_context_restore_spe
-       ldr     x13, [x0, #CTX_PMSCR_EL2]
-       msr     PMSCR_EL2, x13
-       ret
-endfunc el2_sysregs_context_restore_spe
-#endif /* ENABLE_SPE_FOR_LOWER_ELS */
-
 #if CTX_INCLUDE_MTE_REGS
 func el2_sysregs_context_save_mte
        mrs     x9, TFSR_EL2
index 507a8ce8a21723a48141bcff53dd87040481032c..e1c671d8ba48e30cf7bc109231c15241fe1be8c9 100644 (file)
@@ -856,9 +856,6 @@ void cm_el2_sysregs_context_save(uint32_t security_state)
                el2_sysregs_ctx = get_el2_sysregs_ctx(ctx);
 
                el2_sysregs_context_save_common(el2_sysregs_ctx);
-#if ENABLE_SPE_FOR_LOWER_ELS
-               el2_sysregs_context_save_spe(el2_sysregs_ctx);
-#endif
 #if CTX_INCLUDE_MTE_REGS
                el2_sysregs_context_save_mte(el2_sysregs_ctx);
 #endif
@@ -919,9 +916,6 @@ void cm_el2_sysregs_context_restore(uint32_t security_state)
                el2_sysregs_ctx = get_el2_sysregs_ctx(ctx);
 
                el2_sysregs_context_restore_common(el2_sysregs_ctx);
-#if ENABLE_SPE_FOR_LOWER_ELS
-               el2_sysregs_context_restore_spe(el2_sysregs_ctx);
-#endif
 #if CTX_INCLUDE_MTE_REGS
                el2_sysregs_context_restore_mte(el2_sysregs_ctx);
 #endif