| 429f4f6e | 10-Dec-2025 |
Xialin Liu <xialin.liu@arm.com> |
fix(cpus): workaround for C1-Pro erratum 3686597
C1-Pro erratum 3686597 is a Cat B erratum that applies to revisions r0p0, r1p0 and is fixed in r1p1.
This erratum can be avoided by setting IMP_CPUE
fix(cpus): workaround for C1-Pro erratum 3686597
C1-Pro erratum 3686597 is a Cat B erratum that applies to revisions r0p0, r1p0 and is fixed in r1p1.
This erratum can be avoided by setting IMP_CPUECTLR_EL1[57] to 1.
SDEN documentation: https://developer.arm.com/documentation/SDEN-3273080/1300/?lang=en
Change-Id: I59a5d9316bf66793eae5dac08102231d0e2640fb Signed-off-by: Xialin Liu <xialin.liu@arm.com>
show more ...
|
| 38e580e6 | 26-Nov-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
feat(cpufeat): enable USE_SPINLOCK_CAS to FEAT_STATE_CHECKED
The FEAT_LSE enablement predates the FEAT_STATE framework and has never been converted. Since the introduction of USE_SPINLOCK_CAS we've
feat(cpufeat): enable USE_SPINLOCK_CAS to FEAT_STATE_CHECKED
The FEAT_LSE enablement predates the FEAT_STATE framework and has never been converted. Since the introduction of USE_SPINLOCK_CAS we've gained lots of quality of life features that allow for better feature enablement. This patch converts USE_SPINLOCK_CAS to tri-state and adds it to FEATURE_DETECTION to align with all other features.
Instead of introducing the assembly checking for tri-state, this patch translates all locking routines to C inline assembly and uses the standard C helpers. The main benefit is that this gives greater visibility to the compiler about what the functions are doing and lets it optimise better. Namely, it is able to allocate registers itself and inline the functions when LTO is enabled.
An unsuccessful attempt was made to use the instructions directly and have even flow control in C. This, however, made code very complicated and less efficient in the tight loops of the spinlock.
The last use of ARM_ARCH_AT_LEAST goes away with this change and so this macro is removed. It has now been fully superseded by the FEAT_STATE framework.
This change exposes a limitation - RME_GPT_BITLOCK_BLOCK requires USE_SPINLOCK_CAS. This patch does not address this in any way but makes the relationship explicit.
Change-Id: I580081549aceded2dca3e0f4564ee7510a7e56ae Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 4286d16f | 26-Nov-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpufeat): add support for FEAT_UINJ
FEAT_UINJ allows higher ELs to inject Undefined Instruction exceptions into lower ELs by setting SPSR_ELx.UINJ, which updates PSTATE.UINJ on exception return
feat(cpufeat): add support for FEAT_UINJ
FEAT_UINJ allows higher ELs to inject Undefined Instruction exceptions into lower ELs by setting SPSR_ELx.UINJ, which updates PSTATE.UINJ on exception return. When PSTATE.UINJ is set, instruction execution at the lower EL raises an Undefined Instruction exception (EC=0b000000).
This patch introduces support for FEAT_UINJ by updating the inject_undef64() to use hardware undef injection if supported.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I48ad56a58eaab7859d508cfa8dfe81130b873b6b
show more ...
|
| 3a6e53c8 | 11-Nov-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
fix(cpufeat): update feature names and comments
Fix supported feature list for FEAT_CSV2_2/CSV2_3 and add clearer descriptions for LS64_ACCDATA, AIE, and PFAR features.
Signed-off-by: Arvind Ram Pr
fix(cpufeat): update feature names and comments
Fix supported feature list for FEAT_CSV2_2/CSV2_3 and add clearer descriptions for LS64_ACCDATA, AIE, and PFAR features.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I0073db4007b90e4a37c337af789a7f5c98677372
show more ...
|
| f396aec8 | 09-Sep-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpufeat): add support for FEAT_IDTE3
This patch adds support for FEAT_IDTE3, which introduces support for handling the trapping of Group 3 and Group 5 (only GMID_EL1) registers to EL3 (unless t
feat(cpufeat): add support for FEAT_IDTE3
This patch adds support for FEAT_IDTE3, which introduces support for handling the trapping of Group 3 and Group 5 (only GMID_EL1) registers to EL3 (unless trapped to EL2). IDTE3 allows EL3 to modify the view of ID registers for lower ELs, and this capability is used to disable fields of ID registers tied to disabled features.
The ID registers are initially read as-is and stored in context. Then, based on the feature enablement status for each world, if a particular feature is disabled, its corresponding field in the cached ID register is set to Res0. When lower ELs attempt to read an ID register, the cached ID register value is returned. This allows EL3 to prevent lower ELs from accessing feature-specific system registers that are disabled in EL3, even though the hardware implements them.
The emulated ID register values are stored primarily in per-world context, except for certain debug-related ID registers such as ID_AA64DFR0_EL1 and ID_AA64DFR1_EL1, which are stored in the cpu_data and are unique to each PE. This is done to support feature asymmetry that is commonly seen in debug features.
FEAT_IDTE3 traps all Group 3 ID registers in the range op0 == 3, op1 == 0, CRn == 0, CRm == {2–7}, op2 == {0–7} and the Group 5 GMID_EL1 register. However, only a handful of ID registers contain fields used to detect features enabled in EL3. Hence, we only cache those ID registers, while the rest are transparently returned as is to the lower EL.
This patch updates the CREATE_FEATURE_FUNCS macro to generate update_feat_xyz_idreg_field() functions that disable ID register fields on a per-feature basis. The enabled_worlds scope is used to disable ID register fields for security states where the feature is not enabled.
This EXPERIMENTAL feature is controlled by the ENABLE_FEAT_IDTE3 build flag and is currently disabled by default.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I5f998eeab81bb48c7595addc5595313a9ebb96d5
show more ...
|
| d508bab3 | 03-Nov-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpufeat): include enabled security state scope
This patch adds a security state scope to feature function creation. The scope defines the set of worlds (Secure, Non-secure, and Realm) for which
feat(cpufeat): include enabled security state scope
This patch adds a security state scope to feature function creation. The scope defines the set of worlds (Secure, Non-secure, and Realm) for which a given feature is enabled. This allows finer-grained control of feature visibility and ensures that ID register are updated based on feature's enablement status for that world.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: Ia4ba4ea7c0b020a398785a28e7ce25b00ab1f4ec
show more ...
|
| 8515b439 | 03-Nov-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpufeat): add ID register defines and read helpers
Add system register encodings and read helper functions for both AArch32 and AArch64 ID registers.
These additions complete the set of archit
feat(cpufeat): add ID register defines and read helpers
Add system register encodings and read helper functions for both AArch32 and AArch64 ID registers.
These additions complete the set of architectural ID registers that may be trapped as part of FEAT_IDTE3, which enables EL3 to intercept ID register accesses from lower exception levels.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I5d73b78e80d56a0b78ce026dcf70373c8aabd857
show more ...
|
| 7303319b | 08-Nov-2025 |
Chris Kay <chris.kay@arm.com> |
Merge changes from topic "NUMA_AWARE_PER_CPU" into integration
* changes: docs(maintainers): add per-cpu framework into maintainers.rst feat(per-cpu): add documentation for per-cpu framework f
Merge changes from topic "NUMA_AWARE_PER_CPU" into integration
* changes: docs(maintainers): add per-cpu framework into maintainers.rst feat(per-cpu): add documentation for per-cpu framework feat(rdv3): enable numa aware per-cpu for RD-V3-Cfg2 feat(per-cpu): migrate amu_ctx to per-cpu framework feat(per-cpu): migrate spm_core_context to per-cpu framework feat(per-cpu): migrate psci_ns_context to per-cpu framework feat(per-cpu): migrate psci_cpu_pd_nodes to per-cpu framework feat(per-cpu): migrate rmm_context to per-cpu framework feat(per-cpu): integrate per-cpu framework into BL31/BL32 feat(per-cpu): introduce framework accessors/definers feat(per-cpu): introduce linker changes for NUMA aware per-cpu framework docs(changelog): add scope for per-cpu framework
show more ...
|
| 98859b99 | 29-Jan-2025 |
Sammit Joshi <sammit.joshi@arm.com> |
feat(per-cpu): integrate per-cpu framework into BL31/BL32
Integrate per-cpu support into BL31/BL32 by extending the following areas:
Zero-initialization: Treats per-cpu sections like .bss and clear
feat(per-cpu): integrate per-cpu framework into BL31/BL32
Integrate per-cpu support into BL31/BL32 by extending the following areas:
Zero-initialization: Treats per-cpu sections like .bss and clears them during early C runtime initialization. For platforms that enable NUMA_AWARE_PER_CPU, invokes a platform hook to zero-initialize node-specific per-cpu regions.
Cache maintenance: Extends the BL31 exit path to clean dcache lines covering the per-cpu region, ensuring data written by the primary core is visible to secondary cores.
tpidr_el3 setup: Initializes tpidr_el3 with the base address of the current CPU’s per-cpu section. This allows per-cpu framework to resolve local cpu accesses efficiently.
The percpu_data object is currently stored in tpidr_el3. Since the per-cpu framework will use tpidr_el3 for this-cpu access, percpu_data must be migrated to avoid conflict. This commit moves percpu_data to the per-cpu framework.
Signed-off-by: Sammit Joshi <sammit.joshi@arm.com> Signed-off-by: Rohit Mathew <rohit.mathew@arm.com> Change-Id: Iff0c2e1f8c0ebd25c4bb0b09bfe15dd4fbe20561
show more ...
|
| 3c0ebab5 | 31-Oct-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
fix(cpufeat): remove unused FEAT_NV feature functions
The FEAT_NV feature functions were introduced in a8d5d3d54 but never used. This patch cleans up this dead code.
Signed-off-by: Arvind Ram Praka
fix(cpufeat): remove unused FEAT_NV feature functions
The FEAT_NV feature functions were introduced in a8d5d3d54 but never used. This patch cleans up this dead code.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I05fae1bd187782e5de6074a7b265fcdd4b473a68
show more ...
|
| 5e827bf0 | 24-Oct-2025 |
Timothy Hayes <timothy.hayes@arm.com> |
feat(cpufeat): introduce FEAT_RME_GDI support
This patch adds a new build flag ENABLE_FEAT_RME_GDI to enable this feature, along with defining various related register fields. At this point, when en
feat(cpufeat): introduce FEAT_RME_GDI support
This patch adds a new build flag ENABLE_FEAT_RME_GDI to enable this feature, along with defining various related register fields. At this point, when enabled, this feature enables the SA and NSP GPI encodings by setting the corresponding bits in GPCCR_EL3.
Change-Id: I54152fbb3d19b176264e5d16acbcc866725dc290 Signed-off-by: John Powell <john.powell@arm.com> Signed-off-by: Timothy Hayes <timothy.hayes@arm.com>
show more ...
|
| 09a4bcb8 | 17-Sep-2025 |
Girish Pathak <girish.pathak@arm.com> |
feat(cpufeat): add support for FEAT_RME_GPC2
This change adds support for FEAT_RME_GPC2 and Non-Secure-Only (NSO) Physical Address Space.
Previously, all non-secure (NS) memory was accessible to th
feat(cpufeat): add support for FEAT_RME_GPC2
This change adds support for FEAT_RME_GPC2 and Non-Secure-Only (NSO) Physical Address Space.
Previously, all non-secure (NS) memory was accessible to the secure world and realm world. With GPC2 and the NSO bit in the GPT, memory can now be restricted to the non-secure world only. This is enabled automatically on supported systems when ENABLE_RME is true.
Change-Id: I9b70c3a23c5ec7d83bd787d0fb3edd55934f1d05 Signed-off-by: John Powell <john.powell@arm.com> Signed-off-by: Girish Pathak <girish.pathak@arm.com>
show more ...
|
| 714a1a93 | 28-Oct-2025 |
Manish Pandey <manish.pandey2@arm.com> |
fix(cpufeat): extend FEAT_EBEP handling to delegate PMU control to EL2
Currently, the FEAT_EBEP feature presence check is only used for UNDEF injection into lower ELs. However, this feature also aff
fix(cpufeat): extend FEAT_EBEP handling to delegate PMU control to EL2
Currently, the FEAT_EBEP feature presence check is only used for UNDEF injection into lower ELs. However, this feature also affects the access behavior of MDCR_EL2. Specifically, if the PMEE bits in MDCR_EL3 are not set to 0b01, then the MDCR_EL2.PMEE bits cannot be configured by EL2.
This patch extends the use of FEAT_EBEP to delegate PMU IRQ and profiling exception control to EL2 by setting MDCR_EL3.PMEE = 0b01.This ensures that lower ELs can manage PMU configuration.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: Ib7e1d5c72f017b8ffc2131fc57309dd9d811c973
show more ...
|
| 482fbf81 | 29-Oct-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpufeat): use of additional breakpoints
Extended Breakpoints access through mdcr_el3.ebwe is available only when there are greater than 16 breakpoints implemented. Otherwise the EBWE Bit is RES0
fix(cpufeat): use of additional breakpoints
Extended Breakpoints access through mdcr_el3.ebwe is available only when there are greater than 16 breakpoints implemented. Otherwise the EBWE Bit is RES0 and we could skip enabling Extended Breakpoint access.
Ref: https://developer.arm.com/documentation/111107/2025-09/AArch64-Registers/MDCR-EL3--Monitor-Debug-Configuration-Register--EL3-?lang=en
Change-Id: I2b2147e83d65ee9b0492d3cf3adafd5c8cbe17f5 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 45218c64 | 22-Oct-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(el3-runtime): allow RNDR access at EL3 even when RNG_TRAP is enabled
RNG_TRAP will also trap RNDR accesses at EL3 which we don't want as we have no way to handle nested exceptions. Clear the tra
fix(el3-runtime): allow RNDR access at EL3 even when RNG_TRAP is enabled
RNG_TRAP will also trap RNDR accesses at EL3 which we don't want as we have no way to handle nested exceptions. Clear the trap with root context to always allow access at EL3.
Change-Id: I6e4cd8b5a7730f6ffbeed912d9301877d271110d Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| a873d26f | 22-Oct-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(bl1): use per-world context correctly
Currently, the configuration with BL1 and BL2 at SEL1 will transition via el3_exit which will restore per-world context. However, that context is never writ
fix(bl1): use per-world context correctly
Currently, the configuration with BL1 and BL2 at SEL1 will transition via el3_exit which will restore per-world context. However, that context is never written to and so zeroes end up in registers, which is not necessarily correct.
This patch gets BL1 to call cm_manage_extensions_per_world() whenever BL2 runs in a lower EL. This allows the per-world registers to have the reset values we intend. An accompanying call to cm_manage_extensions_el3() is also added for completeness.
Doing this shows a small deficiency in cptr_el3 - bits TFP and TCPAC change a lot. This patch makes them consistent by always setting TCPAC and TFP to 0 which unconditionally enable access to CPTR_EL2 and FPCR by default as they are always accessible. Other places that manipulate the TFP bit are removed.
A nice side effect of all of this is that we're now in a position to enable and use any architectural extension in BL2.
Change-Id: I070d62bbf8e9d9b472caf7e2c931c303523be308 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| d6affea1 | 02-Oct-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(security): add clrbhb support
TF-A mitigates spectre-bhb(CVE-2022-23960) issue with loop workaround based on - https://developer.arm.com/documentation/110280/latest/
On platforms that support `
fix(security): add clrbhb support
TF-A mitigates spectre-bhb(CVE-2022-23960) issue with loop workaround based on - https://developer.arm.com/documentation/110280/latest/
On platforms that support `clrbhb` instruction it is recommended to use `clrbhb` instruction instead of the loop workaround.
Ref- https://developer.arm.com/documentation/102898/0108/
Change-Id: Ie6e56e96378503456a1617d5e5d51bc64c2e0f0b Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 203575c3 | 17-Oct-2025 |
Manish V Badarkhe <manish.badarkhe@arm.com> |
Merge changes Ifbc5ab02,Ib9002609,I0276257d into integration
* changes: fix(fvp): initialise the event log's size to avoid using gibberish values fix(tsp): keep the tsp D128 unaware, not the dis
Merge changes Ifbc5ab02,Ib9002609,I0276257d into integration
* changes: fix(fvp): initialise the event log's size to avoid using gibberish values fix(tsp): keep the tsp D128 unaware, not the dispatcher fix(dice): prevent compiler warnings
show more ...
|
| b3bcfd12 | 14-Aug-2025 |
Andre Przywara <andre.przywara@arm.com> |
feat(cpufeat): enable FEAT_PFAR support
Implement support for FEAT_PFAR, which introduces the PFAR_ELx system register, recording the faulting physical address for some aborts. Those system register
feat(cpufeat): enable FEAT_PFAR support
Implement support for FEAT_PFAR, which introduces the PFAR_ELx system register, recording the faulting physical address for some aborts. Those system registers are trapped by the SCR_EL3.PFARen bit, so set the bit for the non-secure world context to allow OSes to use the feature.
This is controlled by the ENABLE_FEAT_PFAR build flag, which follows the usual semantics of 2 meaning the feature being runtime detected. Let the default for this flag be 0, but set it to 2 for the FVP.
Change-Id: I5c9ae750417e75792f693732df3869e02b6e4319 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| b77c6aac | 13-Oct-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(tsp): keep the tsp D128 unaware, not the dispatcher
The tspd is a core part of the el3 runtime and it must behave the same way, i.e. it must handle FEAT_D128. The tsp on the other hand is a bit
fix(tsp): keep the tsp D128 unaware, not the dispatcher
The tspd is a core part of the el3 runtime and it must behave the same way, i.e. it must handle FEAT_D128. The tsp on the other hand is a bit more special and can have carveouts, which patch f3e2b4997 added.
That incorrectly did it for the tspd instead of the tsp, so fix that.
Change-Id: Ib9002609ef9c66b0d1fcc5b3a9f012376d0c3bf4 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| cc2523bb | 14-Aug-2025 |
Andre Przywara <andre.przywara@arm.com> |
feat(cpufeat): enable FEAT_AIE support
Implement support for FEAT_AIE, which introduces the AMAIR2_ELx and MAIR2_ELx system registers, extending the memory attributes described by {A}MAIR_ELx. Those
feat(cpufeat): enable FEAT_AIE support
Implement support for FEAT_AIE, which introduces the AMAIR2_ELx and MAIR2_ELx system registers, extending the memory attributes described by {A}MAIR_ELx. Those system registers are trapped by the SCR_EL3.AIEn bit, so set the bit for the non-secure world context to allow OSes to use the feature.
This is controlled by the ENABLE_FEAT_AIE build flag, which follows the usual semantics of 2 meaning the feature being runtime detected. Let the default for this flag be 0, but set it to 2 for the FVP.
Change-Id: Iba2011719013a89f9cb3a4317bde18254f45cd25 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| 1f866fc9 | 18-Sep-2025 |
Amr Mohamed <amr.mohamed@arm.com> |
feat(dsu): enable PMU registers access at EL1
- Disable trapping of write accesses to DSU cluster PMU registers at EL3 and EL2. - Clear the SPME bit in CLUSTERPMMDCR_EL3 to prohibit PMU event co
feat(dsu): enable PMU registers access at EL1
- Disable trapping of write accesses to DSU cluster PMU registers at EL3 and EL2. - Clear the SPME bit in CLUSTERPMMDCR_EL3 to prohibit PMU event counting in the secure state.
Change-Id: If3eb6e997330ae86f45760e0e862c003861f3d66 Signed-off-by: Amr Mohamed <amr.mohamed@arm.com>
show more ...
|
| 46aff6fc | 26-Sep-2025 |
Mark Dykes <mark.dykes@arm.com> |
Merge "refactor(el3-runtime): move context security states to context.h" into integration |
| a1032beb | 20-Aug-2025 |
John Powell <john.powell@arm.com> |
feat(cpufeat): enable FEAT_CPA2 for EL3
FEAT_CPA2 enables checked pointer arithmetic, which in the event of an arithmetic overflow in pointer generation will result in a non-canonical pointer being
feat(cpufeat): enable FEAT_CPA2 for EL3
FEAT_CPA2 enables checked pointer arithmetic, which in the event of an arithmetic overflow in pointer generation will result in a non-canonical pointer being generated and subsequent address fault.
Note that FEAT_CPA is a trivial implementation that exists in some hardware purely so it can run CPA2-enabled instructions without crashing but they don't actually have checked arithmetic, so FEAT_CPA is not explicitly enabled in TF-A.
Change-Id: I6d2ca7a7e4b986bb9e917aa8baf8091a271c168b Signed-off-by: John Powell <john.powell@arm.com>
show more ...
|
| 34a22a02 | 05-Aug-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(el3-runtime): move context security states to context.h
The three security states (S, NS, RL) are architecturally quite consistent - anything that uses them has the same numerical assignmen
refactor(el3-runtime): move context security states to context.h
The three security states (S, NS, RL) are architecturally quite consistent - anything that uses them has the same numerical assignments (0, 1, 2) and they are quite convenient for indexing. However, we're not as consistent in tf-a and this is defined in a few places. Since cpu_data has a dependency on the context management library, use its security state convention in a few more places and take away this responsibility from cpu_data.
Change-Id: Iec73b2be2eef91975554767557de72424d0031f1 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|