| 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 ...
|
| 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 ...
|
| 25fe31b2 | 22-May-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cpufeat): add ras files to the build from a common location
If ENABLE_FEAT_RAS is unset on the build commandline the platform.mk will run and make its decisions with the flag unset, after which
fix(cpufeat): add ras files to the build from a common location
If ENABLE_FEAT_RAS is unset on the build commandline the platform.mk will run and make its decisions with the flag unset, after which arch_features.mk will run and enable the feature. The result in the RAS case is a build failure due to missing symbols.
Nvidia works around this by setting ENABLE_FEAT_RAS manually despite the arch_features.mk setting.
Every platform that enables ENABLE_FEAT_RAS also pulls in std_err_record.c and ras_common.c. So fix the build failure by having these files be pulled into the build from common code in bl31.mk.
Change-Id: I018869d3f1904821523ac88d70e88eb90959784b Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| f9f4944d | 04-Jul-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cm): do not restore spsr and elr twice on external aborts
el3_exit will restore SPSR_EL3 and ELR_EL3. There is no need to do it in ea_proceed too as that is always followed by el3_exit.
Change-
fix(cm): do not restore spsr and elr twice on external aborts
el3_exit will restore SPSR_EL3 and ELR_EL3. There is no need to do it in ea_proceed too as that is always followed by el3_exit.
Change-Id: I9089b3ada7785bc0d5fd1e05192f456ffe666789 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| a202529e | 22-May-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cm): do not save SCR_EL3 on external aborts
SCR_EL3 is static. For non-root worlds, once initialised by cm_setup_context(), its value is immutable and only restored by el3_exit(). For the root w
fix(cm): do not save SCR_EL3 on external aborts
SCR_EL3 is static. For non-root worlds, once initialised by cm_setup_context(), its value is immutable and only restored by el3_exit(). For the root world (or EL3 when that's not a thing) setup_el3_execution_context() (via prepare_el3_entry()) will write a different static value in, with the expectation that el3_exit() will wipe it. As such saving scr_el3 in the case of a double fault is not necessary, and even harmful as the wrong (root's) value will get written in.
Change-Id: Ibf5b3a809fc0208a98ded20fe8d50c7405f808b9 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 8f152319 | 11-Aug-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(aarch64): do not print EL1 registers on EL3 panic
Lower EL execution should not be able to panic EL3. The main source of potential panic, traps from lower ELs, are now handled gracefully with un
fix(aarch64): do not print EL1 registers on EL3 panic
Lower EL execution should not be able to panic EL3. The main source of potential panic, traps from lower ELs, are now handled gracefully with undefined injection. Almost every other source of panic is something going wrong within TF-A. Regardless, in both cases, ESR_EL3, ELR_EL3, and SPSR_ELR provide the majority of necessary information to debug a panic and printing a lot of lower EL register only clutters the crash dump and makes it difficult to read.
Further, when EL3 panics, the ultimate source of that panic may be EL2 but the crash reporting functionality only prints out EL1 system registers which are going to be quite useless to debug.
Finally, the panic may be happening due to some misconfiguration of other EL3 system registers that have been introduced with a feature.
There are two logical choices: a) extend crash reporting to report all EL1, EL2, and EL3 registers depending on where an error came from, including all features b) only print core EL3 registers and rely on the developer to add extra prints as necessary
We have never strived to achieve a) (as evidenced by EL2 and feature sysregs never having been added), so do b). Only non-EL3 registers that are relevant to EL3's direct execution are kept (like SP_EL0).
Change-Id: Ife2fe86184bca9a4d66f367c516eececc57471da Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 63900851 | 11-Sep-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(aarch64): move BL31 specific setup out of the PSCI entrypoint
We've charged the PSCI entrypoint with doing BL31 specific things like setting up the EL3 context and doing feature detection.
refactor(aarch64): move BL31 specific setup out of the PSCI entrypoint
We've charged the PSCI entrypoint with doing BL31 specific things like setting up the EL3 context and doing feature detection. Well, this is irrelevant for sp_min and not really appropriate for PSCI. So move it to the bl31_warmboot() function to reflect this correctly and bring the feature detection a bit earlier, hopefully spotting more errors.
This allows for a pair of minor cleanups - we can pass the core_pos to psci_warmboot_entrypoint() without having to refetch it, and we can put the pauth enablement in cm_manage_extensions_el3() along with all others. The call of that function is kept after the MMU is turned on so that we have nicer (coherent) access to cpu_data.
Change-Id: Id031cfa0e1d8fe98919a14f9db73eb5bc9e00f67 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 0f57a388 | 03-Jul-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cpufeat): do feature detection before feature enablement
Situations where feature configuration does not reflect hardware's features can cause unhandled exceptions at EL3. Feature detection is m
fix(cpufeat): do feature detection before feature enablement
Situations where feature configuration does not reflect hardware's features can cause unhandled exceptions at EL3. Feature detection is meant to guard against these errors by checking hardware against the configuration. For this to happen though, feature detection has to happen before these unhandled exceptions have had a chance to happen.
Change-Id: I47f05a9f01321e011623083afb638552311ed013 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|