| d20052f3 | 04-Apr-2022 |
Zelalem Aweke <zelalem.aweke@arm.com> |
refactor(context mgmt): refactor EL2 context save and restore functions
This patch splits the el2_sysregs_context_save/restore functions into multiple functions based on features. This will allow us
refactor(context mgmt): refactor EL2 context save and restore functions
This patch splits the el2_sysregs_context_save/restore functions into multiple functions based on features. This will allow us to selectively save and restore EL2 context registers based on features enabled for a particular configuration.
For now feature build flags are used to decide which registers to save and restore. The long term plan is to dynamically check for features that are enabled and then save/restore registers accordingly. Splitting el2_sysregs_context_save/restore functions into smaller assembly functions makes that task easier. For more information please take a look at: https://trustedfirmware-a.readthedocs.io/en/latest/design_documents/context_mgmt_rework.html
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Change-Id: I1819a9de8b70fa35c8f45568908025f790c4808c
show more ...
|
| b515f541 | 08-Apr-2022 |
Zelalem Aweke <zelalem.aweke@arm.com> |
refactor(context mgmt): refactor initialization of EL1 context registers
When SPMC is present at S-EL2, EL1 context registers don't need to be initialized for Secure state. This patch makes sure tha
refactor(context mgmt): refactor initialization of EL1 context registers
When SPMC is present at S-EL2, EL1 context registers don't need to be initialized for Secure state. This patch makes sure that EL1 context registers are initialized only for Non-secure state, and when SPMC is not present at S-EL2
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Change-Id: I4a60b258c31ce5f6472a243e2687159cc495259b
show more ...
|
| 926224e2 | 10-May-2022 |
Joanna Farley <joanna.farley@arm.com> |
Merge "fix(amu): limit virtual offset register access to NS world" into integration |
| 18c33208 | 10-May-2022 |
Olivier Deprez <olivier.deprez@arm.com> |
Merge "fix(cm): add barrier before el3 ns exit" into integration |
| 04825031 | 09-May-2022 |
Olivier Deprez <olivier.deprez@arm.com> |
fix(cm): add barrier before el3 ns exit
In cm_prepare_el3_exit_ns, SCR_EL3.NS bit change (to non-secure) is not committed before the EL2 restoration sequence happens. At ICC_SRE_EL2 write in cm_el2_
fix(cm): add barrier before el3 ns exit
In cm_prepare_el3_exit_ns, SCR_EL3.NS bit change (to non-secure) is not committed before the EL2 restoration sequence happens. At ICC_SRE_EL2 write in cm_el2_sysregs_context_restore, NS is still 0 from CPU perspective (with EEL2=0) which is an invalid condition and triggers a fault. By adding ISB, SCR_EL3 gets synced with NS=1/EEL2=0 before ICC_SRE_EL2 write.
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: Ie72a6152aa7729e66b3344c1b7b0749f54cafb6f
show more ...
|
| 744ad974 | 28-Jan-2022 |
johpow01 <john.powell@arm.com> |
feat(brbe): add BRBE support for NS world
This patch enables access to the branch record buffer control registers in non-secure EL2 and EL1 using the new build option ENABLE_BRBE_FOR_NS. It is disab
feat(brbe): add BRBE support for NS world
This patch enables access to the branch record buffer control registers in non-secure EL2 and EL1 using the new build option ENABLE_BRBE_FOR_NS. It is disabled for all secure world, and cannot be used with ENABLE_RME.
This option is disabled by default, however, the FVP platform makefile enables it for FVP builds.
Signed-off-by: John Powell <john.powell@arm.com> Change-Id: I576a49d446a8a73286ea6417c16bd0b8de71fca0
show more ...
|
| a4c39456 | 29-Mar-2022 |
John Powell <john.powell@arm.com> |
fix(amu): limit virtual offset register access to NS world
Previously the SCR_EL3.AMVOFFEN bit was set for all contexts, this behavior is incorrect as it allows secure world to access the virtual of
fix(amu): limit virtual offset register access to NS world
Previously the SCR_EL3.AMVOFFEN bit was set for all contexts, this behavior is incorrect as it allows secure world to access the virtual offset registers when it should not be able to. This patch only sets AMVOFFEN for non-secure world.
Signed-off-by: John Powell <john.powell@arm.com> Change-Id: I2c61fe0a8a0092df089f1cb2c0d8a45c8c8ad0d3
show more ...
|
| 781d07a4 | 28-Mar-2022 |
Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> |
refactor(twed): improve TWED enablement in EL-3
The current implementation uses plat_arm API under generic code. "plat_arm" API is a convention used with Arm common platform layer and is reserved fo
refactor(twed): improve TWED enablement in EL-3
The current implementation uses plat_arm API under generic code. "plat_arm" API is a convention used with Arm common platform layer and is reserved for that purpose. In addition, the function has a weak definition which is not encouraged in TF-A.
Henceforth, removing the weak API with a configurable macro "TWED_DELAY" of numeric data type in generic code and simplifying the implementation. By default "TWED_DELAY" is defined to zero, and the delay value need to be explicitly set by the platforms during buildtime.
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> Change-Id: I25cd6f628e863dc40415ced3a82d0662fdf2d75a
show more ...
|
| 8b95e848 | 31-Jan-2022 |
Zelalem Aweke <zelalem.aweke@arm.com> |
refactor(context mgmt): add cm_prepare_el3_exit_ns function
As part of the RFC: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/13651, this patch adds the 'cm_prepare_el3_exit_ns' fun
refactor(context mgmt): add cm_prepare_el3_exit_ns function
As part of the RFC: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/13651, this patch adds the 'cm_prepare_el3_exit_ns' function. The function is a wrapper to 'cm_prepare_el3_exit' function for Non-secure state.
When EL2 sysregs context exists (CTX_INCLUDE_EL2_REGS is enabled) EL1 and EL2 sysreg values are restored from the context instead of directly updating the registers.
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Change-Id: I9b071030576bb05500d54090e2a03b3f125d1653
show more ...
|
| 2bbad1d1 | 05-Jan-2022 |
Zelalem Aweke <zelalem.aweke@arm.com> |
refactor(context mgmt): refactor the cm_setup_context function
This patch splits the function 'cm_setup_context' into four functions to make it more readable and easier to maintain.
The function is
refactor(context mgmt): refactor the cm_setup_context function
This patch splits the function 'cm_setup_context' into four functions to make it more readable and easier to maintain.
The function is split into the following functions based on the security state of the context.
- setup_context_common - performs common initializations - setup_secure_context - performs Secure state specific initializations - setup_realm_context - performs Realm state specific initializations - setup_ns_context - performs Non-secure state specific initializations
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Change-Id: Ie14a1c2fc6586087e7aa36537cf9064c80802f8f
show more ...
|
| 7f41bcc7 | 03-Nov-2021 |
Zelalem Aweke <zelalem.aweke@arm.com> |
refactor(context mgmt): remove registers accessible only from secure state from EL2 context
The following registers are only accessible from secure state, therefore don't need to be saved/restored d
refactor(context mgmt): remove registers accessible only from secure state from EL2 context
The following registers are only accessible from secure state, therefore don't need to be saved/restored during world switch. - SDER32_EL2 - VSTCR_EL2 - VSTTBR_EL2
This patch removes these registers from EL2 context.
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Change-Id: I24d08aacb1b6def261c7b37d3e1265bb76adafdc
show more ...
|
| 0ce220af | 26-Jan-2022 |
Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> |
refactor(el3-runtime): replace ARM_ARCH_AT_LEAST macro with FEAT flags
Replacing ARM_ARCH_AT_LEAST macro with feature specific build options to prevent unconditional accesses to the registers during
refactor(el3-runtime): replace ARM_ARCH_AT_LEAST macro with FEAT flags
Replacing ARM_ARCH_AT_LEAST macro with feature specific build options to prevent unconditional accesses to the registers during context save and restore routines.
Registers are tightly coupled with features more than architecture versions. Henceforth having a feature-specific build flag guarding the respective registers, will restrict any undefined actions.
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> Change-Id: I809774df580530803c8a6e05a62d8d4de0910e02
show more ...
|
| 7d33ffe4 | 25-May-2021 |
Daniel Boulby <daniel.boulby@arm.com> |
fix(el3-runtime): set unset pstate bits to default
During a transition to a higher EL some of the PSTATE bits are not set by hardware, this means that their state may be leaked from lower ELs. This
fix(el3-runtime): set unset pstate bits to default
During a transition to a higher EL some of the PSTATE bits are not set by hardware, this means that their state may be leaked from lower ELs. This patch sets those bits to a default value upon entry to EL3.
This patch was tested using a debugger to check the PSTATE values are correctly set. As well as adding a test in the next patch to ensure the PSTATE in lower ELs is still maintained after this change.
Change-Id: Ie546acbca7b9aa3c86bd68185edded91b2a64ae5 Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
show more ...
|
| 97215e0f | 19-Jan-2022 |
Daniel Boulby <daniel.boulby@arm.com> |
refactor(el3-runtime): add prepare_el3_entry func
In the next patch we add an extra step of setting the PSTATE registers to a known state on el3 entry. In this patch we create the function prepare_e
refactor(el3-runtime): add prepare_el3_entry func
In the next patch we add an extra step of setting the PSTATE registers to a known state on el3 entry. In this patch we create the function prepare_el3_entry to wrap the steps needed for before el3 entry. For now this is only save_gp_pmcr_pauth_regs.
Change-Id: Ie26dc8d89bfaec308769165d2649e84d41be196c Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
show more ...
|
| f74cb0be | 25-Nov-2021 |
Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> |
fix(amu): fault handling on EL2 context switch
The HAFGRTR_EL2 register is UNDEFINED unless the CPU supports both FEAT_FGT and FEAT_AMUv1. FEAT_FGT is mandatory for v8.6-A and upwards, but FEAT_AMUv
fix(amu): fault handling on EL2 context switch
The HAFGRTR_EL2 register is UNDEFINED unless the CPU supports both FEAT_FGT and FEAT_AMUv1. FEAT_FGT is mandatory for v8.6-A and upwards, but FEAT_AMUv1 is optional (from v8.4-A upwards), and as such any 8.6-A cores today without support for FEAT_AMUv1 will trigger an undefined instruction exception on accessing this register.
Currently ARM_ARCH_AT_LEAST macro has been used to associate with an architecture extension allowing to access HAFGRTR_EL2 register. This condition should be replaced with macros specific to individual features. This patch adds a new set of macros "ENABLE_FEAT_FGT, ENABLE_FEAT_AMUv1, ENABLE_FEAT_ECV" under build options to provide controlled access to the HAFGRTR_EL2 register.
Further to ensure that the the build options passed comply with the given hardware implementation, a feature detection mechanism, checking whether build options match with the architecture is required at bootime. This will be implemented and pushed later in a separate patch.
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> Change-Id: Ie390f4babe233b8b09455290277edbddecd33ead
show more ...
|
| dc78e62d | 08-Jul-2021 |
johpow01 <john.powell@arm.com> |
feat(sme): enable SME functionality
This patch adds two new compile time options to enable SME in TF-A: ENABLE_SME_FOR_NS and ENABLE_SME_FOR_SWD for use in non-secure and secure worlds respectively.
feat(sme): enable SME functionality
This patch adds two new compile time options to enable SME in TF-A: ENABLE_SME_FOR_NS and ENABLE_SME_FOR_SWD for use in non-secure and secure worlds respectively. Setting ENABLE_SME_FOR_NS=1 will enable SME for non-secure worlds and trap SME, SVE, and FPU/SIMD instructions in secure context. Setting ENABLE_SME_FOR_SWD=1 will disable these traps, but support for SME context management does not yet exist in SPM so building with SPD=spmd will fail.
The existing ENABLE_SVE_FOR_NS and ENABLE_SVE_FOR_SWD options cannot be used with SME as it is a superset of SVE and will enable SVE and FPU/SIMD along with SME.
Signed-off-by: John Powell <john.powell@arm.com> Change-Id: Iaaac9d22fe37b4a92315207891da848a8fd0ed73
show more ...
|
| c5ea4f8a | 09-Jul-2021 |
Zelalem Aweke <zelalem.aweke@arm.com> |
feat(rme): add context management changes for FEAT_RME
This patch adds a new context for realm world and realm world awareness in context management.
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm
feat(rme): add context management changes for FEAT_RME
This patch adds a new context for realm world and realm world awareness in context management.
Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Signed-off-by: Subhasish Ghosh <subhasish.ghosh@arm.com> Change-Id: Ic17469393603e789d7adc025880346bc3d6233d7
show more ...
|
| cb4ec47b | 05-Aug-2021 |
johpow01 <john.powell@arm.com> |
feat(hcx): add build option to enable FEAT_HCX
FEAT_HCX adds the extended hypervisor configuration register (HCRX_EL2) and access to this register must be explicitly enabled through the SCR_EL3.HXEn
feat(hcx): add build option to enable FEAT_HCX
FEAT_HCX adds the extended hypervisor configuration register (HCRX_EL2) and access to this register must be explicitly enabled through the SCR_EL3.HXEn bit. This patch adds a new build flag ENABLE_FEAT_HCX to allow the register to be accessed from EL2.
Signed-off-by: John Powell <john.powell@arm.com> Change-Id: Ibb36ad90622f1dc857adab4b0d4d7a89456a522b
show more ...
|
| 8fcd3d96 | 08-Jul-2021 |
Manish V Badarkhe <Manish.Badarkhe@arm.com> |
feat(trf): enable trace filter control register access from lower NS EL
Introduced a build flag 'ENABLE_TRF_FOR_NS' to enable trace filter control registers access in NS-EL2, or NS-EL1 (when NS-EL2
feat(trf): enable trace filter control register access from lower NS EL
Introduced a build flag 'ENABLE_TRF_FOR_NS' to enable trace filter control registers access in NS-EL2, or NS-EL1 (when NS-EL2 is implemented but unused).
Change-Id: If3f53b8173a5573424b9a405a4bd8c206ffdeb8c Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
show more ...
|
| d4582d30 | 29-Jun-2021 |
Manish V Badarkhe <Manish.Badarkhe@arm.com> |
feat(sys_reg_trace): enable trace system registers access from lower NS ELs
Introduced a build flag 'ENABLE_SYS_REG_TRACE_FOR_NS' to enable trace system registers access in NS-EL2, or NS-EL1 (when N
feat(sys_reg_trace): enable trace system registers access from lower NS ELs
Introduced a build flag 'ENABLE_SYS_REG_TRACE_FOR_NS' to enable trace system registers access in NS-EL2, or NS-EL1 (when NS-EL2 is implemented but unused).
Change-Id: Idc1acede4186e101758cbf7bed5af7b634d7d18d Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
show more ...
|
| 813524ea | 02-Jul-2021 |
Manish V Badarkhe <Manish.Badarkhe@arm.com> |
feat(trbe): enable access to trace buffer control registers from lower NS EL
Introduced a build flag 'ENABLE_TRBE_FOR_NS' to enable trace buffer control registers access in NS-EL2, or NS-EL1 (when N
feat(trbe): enable access to trace buffer control registers from lower NS EL
Introduced a build flag 'ENABLE_TRBE_FOR_NS' to enable trace buffer control registers access in NS-EL2, or NS-EL1 (when NS-EL2 is implemented but unused).
Change-Id: I285a672ccd395eebd377714c992bb21062a729cc Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
show more ...
|
| 40ff9074 | 23-Jun-2021 |
Manish V Badarkhe <Manish.Badarkhe@arm.com> |
feat(trbe): initialize trap settings of trace buffer control registers access
Trap bits of trace buffer control registers access are in architecturally UNKNOWN state at boot hence
1. Initialized th
feat(trbe): initialize trap settings of trace buffer control registers access
Trap bits of trace buffer control registers access are in architecturally UNKNOWN state at boot hence
1. Initialized these bits to zero to prohibit trace buffer control registers accesses in lower ELs (EL2, EL1) in all security states when FEAT_TRBE is implemented 2. Also, these bits are RES0 when FEAT_TRBE is not implemented, and hence setting it to zero also aligns with the Arm ARM reference recommendation, that mentions software must writes RES0 bits with all 0s
Change-Id: If2752fd314881219f232f21d8e172a9c6d341ea1 Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
show more ...
|
| 68ac5ed0 | 08-Jul-2021 |
Arunachalam Ganapathy <arunachalam.ganapathy@arm.com> |
fix(el3_runtime): fix SVE and AMU extension enablement flags
If SVE are enabled for both Non-secure and Secure world along with AMU extension, then it causes the TAM_BIT in CPTR_EL3 to be set upon e
fix(el3_runtime): fix SVE and AMU extension enablement flags
If SVE are enabled for both Non-secure and Secure world along with AMU extension, then it causes the TAM_BIT in CPTR_EL3 to be set upon exit from bl31. This restricts access to the AMU register set in normal world. This fix maintains consistency in both TAM_BIT and CPTR_EZ_BIT by saving and restoring CPTR_EL3 register from EL3 context.
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com> Change-Id: Id76ce1d27ee48bed65eb32392036377716aff087
show more ...
|
| 0c5e7d1c | 22-Mar-2021 |
Max Shvetsov <maksims.svecovs@arm.com> |
feat(sve): enable SVE for the secure world
Enables SVE support for the secure world via ENABLE_SVE_FOR_SWD. ENABLE_SVE_FOR_SWD defaults to 0 and has to be explicitly set by the platform. SVE is conf
feat(sve): enable SVE for the secure world
Enables SVE support for the secure world via ENABLE_SVE_FOR_SWD. ENABLE_SVE_FOR_SWD defaults to 0 and has to be explicitly set by the platform. SVE is configured during initial setup and then uses EL3 context save/restore routine to switch between SVE configurations for different contexts. Reset value of CPTR_EL3 changed to be most restrictive by default.
Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com> Change-Id: I889fbbc2e435435d66779b73a2d90d1188bf4116
show more ...
|
| 66bf006e | 08-Jun-2021 |
Mark Dykes <mark.dykes@arm.com> |
Merge "fix(security): Set MDCR_EL3.MCCD bit" into integration |