| 6597fcf1 | 26-Jun-2023 |
Manish Pandey <manish.pandey2@arm.com> |
feat(ras): use FEAT_IESB for error synchronization
For synchronization of errors at exception boundries TF-A uses "esb" instruction with FEAT_RAS or "dsb" and "isb" otherwise. The problem with esb i
feat(ras): use FEAT_IESB for error synchronization
For synchronization of errors at exception boundries TF-A uses "esb" instruction with FEAT_RAS or "dsb" and "isb" otherwise. The problem with esb instruction is, along with synching errors it might also consume the error, which is not ideal in all scenarios. On the other hand we can't use dsb always as its in the hot path.
To solve above mentioned problem the best way is to use FEAT_IESB feature which provides controls to insert an implicit Error synchronization event at exception entry and exception return.
Assumption in TF-A is, if RAS Extension is present then FEAT_IESB will also be present and enabled.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: Ie5861eec5da4028a116406bb4d1fea7dac232456
show more ...
|
| d04c04a4 | 25-May-2023 |
Manish Pandey <manish.pandey2@arm.com> |
feat(el3-runtime): modify vector entry paths
Vector entries in EL3 from lower ELs, first check for any pending async EAs from lower EL before handling the original exception. This happens when there
feat(el3-runtime): modify vector entry paths
Vector entries in EL3 from lower ELs, first check for any pending async EAs from lower EL before handling the original exception. This happens when there is an error (EA) in the system which is not yet signaled to PE while executing at lower EL. During entry into EL3 the errors (EA) are synchronized causing async EA to pend at EL3.
On detecting the pending EA (via ISR_EL1.A) EL3 either reflects it back to lower EL (KFH) or handles it in EL3 (FFH) based on EA routing model.
In case of Firmware First handling mode (FFH), EL3 handles the pended EA first before returing back to handle the original exception.
While in case of Kernel First handling mode (KFH), EL3 will return back to lower EL without handling the original exception. On returing to lower EL, EA will be pended. In KFH mode there is a risk of back and forth between EL3 and lower EL if the EA is masked at lower EL or priority of EA is lower than that of original exception. This is a limitation in current architecture but can be solved in future if EL3 gets a capability to inject virtual SError.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: I3a2a31de7cf454d9d690b1ef769432a5b24f6c11
show more ...
|
| 9f4b6259 | 22-Sep-2023 |
Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> |
refactor(cm): enable S-EL2 globally for all contexts
Currently, S-EL2 is being enabled specifically while we are in secure context and gets toggled up when we exit secure world. This behavior is not
refactor(cm): enable S-EL2 globally for all contexts
Currently, S-EL2 is being enabled specifically while we are in secure context and gets toggled up when we exit secure world. This behavior is not ideal and needs correction.
Enabling the S-EL2 via SCR_EL3.EEL2 register setting should be global and this patch addresses it.
Change-Id: If6c39ca258f2fefa835c4b51e0f6b68165fd2e35 Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
show more ...
|
| 5c52d7e5 | 22-May-2023 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cm): remove world differentiation for EL2 context restore
The EL2 context save/restore functions have an optimisation to not bother with the EL2 context when SEL2 is not in use. However, th
refactor(cm): remove world differentiation for EL2 context restore
The EL2 context save/restore functions have an optimisation to not bother with the EL2 context when SEL2 is not in use. However, this decision is made on the current value of SCR_EL3.EEL2, which is not the value for the selected security state, but rather, for the security state that came before it. This relies on the EEL2 bit's value to propagate identically to all worlds.
This has an unintended side effect that for the first entry into secure world, the restoring of the context is fully skipped, because SCR_EL3 is only initialized after the call to the restoring routine which means the EEL2 bit is not initialized (except when FEAT_RME is present). This is inconsistent with normal and realm worlds which always get their EL2 registers zeroed.
Remove this optimization to remove all the complexity with managing the EEL2 bit's value. Instead unconditionally save/restore all registers. It is worth noting that there is no performance penalty in the case where SEL2 is empty with this change. This is because SEL2 will never be entered, and as such no secure save/restore will happen anyway, while normal world remains unchanged.
Removing the value management of the EEL2 bit causes the CTX_ICC_SRE_EL2 register to be inaccessible in Secure world for some configurations. Make the SCR_EL3.NS workaround in cm_prepare_el3_exit_ns() generic on every access to the register.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Change-Id: I1f56d85814c5897b468e82d4bd4a08e3a90a7f8f
show more ...
|
| 5e8cc727 | 23-May-2023 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cm): make ICC_SRE_EL2 fixup generic to all worlds
For ICC_SRE_EL2.SRE the Arm ARM specifies that "If software changes this bit from 1 to 0, the results are UNPREDICTABLE". However, the indiscrim
fix(cm): make ICC_SRE_EL2 fixup generic to all worlds
For ICC_SRE_EL2.SRE the Arm ARM specifies that "If software changes this bit from 1 to 0, the results are UNPREDICTABLE". However, the indiscriminate zeroing of the EL2 context does just that for Secure and Realm worlds. Make this fixup generic to avoid the problem.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> Change-Id: Iee21ace17faf10eae52a046e6dfafc5141fa7f85
show more ...
|
| ece8f7d7 | 13-Feb-2023 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cm): set MDCR_EL3/CPTR_EL3 bits in respective feat_init_el3() only
These bits (MDCR_EL3.{NSTB, NSTBE, TTRF, TPM}, CPTR_EL3.TTA) only affect EL2 (and lower) execution. Each feat_init_el3() i
refactor(cm): set MDCR_EL3/CPTR_EL3 bits in respective feat_init_el3() only
These bits (MDCR_EL3.{NSTB, NSTBE, TTRF, TPM}, CPTR_EL3.TTA) only affect EL2 (and lower) execution. Each feat_init_el3() is called long before any lower EL has had a chance to execute, so setting the bits at reset is redundant. Removing them from reset code also improves readability of the immutable EL3 state.
Preserve the original intention for the TTA bit of "enabled for NS and disabled everywhere else" (inferred from commit messages d4582d3088 and 2031d6166a and the comment). This is because CPTR_EL3 will be contexted and so everyone will eventually get whatever NS has anyway.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Change-Id: I3d24b45d3ea80882c8e450b2d9db9d5531facec1
show more ...
|
| 4085a02c | 27-Mar-2023 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(amu): separate the EL2 and EL3 enablement code
Combining the EL2 and EL3 enablement code necessitates that it must be called at el3_exit, which is the only place with enough context to make
refactor(amu): separate the EL2 and EL3 enablement code
Combining the EL2 and EL3 enablement code necessitates that it must be called at el3_exit, which is the only place with enough context to make the decision of what needs to be set. Decouple them to allow them to be called from elsewhere. Also take some time to clarify and simplify AMU code.
The sanity check in the context_restore() is now wrong, as the cpu may turn off on suspend, thus resetting the value of the counter enables. Remove it.
Finally, this completes the migration to cm_manage_extensions_el3() and manage_extensions_nonsecure() so manage_extensions_nonsecure_mixed() is being removed.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Change-Id: I66399132364c32be66017506bb54cbadd8485577
show more ...
|