summaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2022-10-11 15:38:27 +0200
committerOlivier Deprez <olivier.deprez@arm.com>2022-11-08 09:28:36 +0100
commit0fe7b9f2bcdf754c483399c841e5f0ec71e53ef3 (patch)
tree19b351ad6560734af1050a33a2c7465bdc41f4ca /bl31
parent54b3fc63e408ebe3cc79887886df9f9d4c3ecd4d (diff)
downloadarm-trusted-firmware-0fe7b9f2bcdf754c483399c841e5f0ec71e53ef3.tar.gz
feat: pass SMCCCv1.3 SVE hint bit to dispatchers
SMCCCv1.3 introduces the SVE hint bit added to the SMC FID (bit 16) denoting that the world issuing an SMC doesn't expect the callee to preserve the SVE state (FFR, predicates, Zn vector bits greater than 127). Update the generic SMC handler to copy the SVE hint bit state to SMC flags and mask out the bit by default for the services called by the standard dispatcher. It is permitted by the SMCCC standard to ignore the bit as long as the SVE state is preserved. In any case a callee must preserve the NEON state (FPCR/FPSR, Vn 128b vectors) whichever the SVE hint bit state. Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: I2b163ed83dc311b8f81f96b23c942829ae9fa1b5
Diffstat (limited to 'bl31')
-rw-r--r--bl31/aarch64/runtime_exceptions.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S
index bf5bd8d8d..028355396 100644
--- a/bl31/aarch64/runtime_exceptions.S
+++ b/bl31/aarch64/runtime_exceptions.S
@@ -512,7 +512,7 @@ smc_handler64:
/*
* Shift copied SCR_EL3.NSE bit by 5 to create space for
- * SCR_EL3.NS bit. Bit 5 of the flag correspondes to
+ * SCR_EL3.NS bit. Bit 5 of the flag corresponds to
* the SCR_EL3.NSE bit.
*/
lsl x7, x7, #5
@@ -521,6 +521,16 @@ smc_handler64:
/* Copy SCR_EL3.NS bit to the flag to indicate caller's security */
bfi x7, x18, #0, #1
+ /*
+ * Per SMCCCv1.3 a caller can set the SVE hint bit in the SMC FID
+ * passed through x0. Copy the SVE hint bit to flags and mask the
+ * bit in smc_fid passed to the standard service dispatcher.
+ * A service/dispatcher can retrieve the SVE hint bit state from
+ * flags using the appropriate helper.
+ */
+ bfi x7, x0, #FUNCID_SVE_HINT_SHIFT, #FUNCID_SVE_HINT_MASK
+ bic x0, x0, #(FUNCID_SVE_HINT_MASK << FUNCID_SVE_HINT_SHIFT)
+
mov sp, x12
/* Get the unique owning entity number */