| aabab09e | 01-Sep-2025 |
Manish Pandey <manish.pandey2@arm.com> |
Merge changes Id38d6f1b,I5fcfe8dd,I7f3b50e5 into integration
* changes: fix(cpus): inform the compiler that struct cpu_ops is aligned refactor(el3-runtime): move the initialisation of the cpu_op
Merge changes Id38d6f1b,I5fcfe8dd,I7f3b50e5 into integration
* changes: fix(cpus): inform the compiler that struct cpu_ops is aligned refactor(el3-runtime): move the initialisation of the cpu_ops_ptr to C fix(aarch32): make get_cpu_ops_ptr() PCS compliant
show more ...
|
| 022fcb48 | 14-Aug-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(el3-runtime): move the initialisation of the cpu_ops_ptr to C
The difference between AArch32 and AArch64 is insignificant and the usage is identical. The only thing that required the use of
refactor(el3-runtime): move the initialisation of the cpu_ops_ptr to C
The difference between AArch32 and AArch64 is insignificant and the usage is identical. The only thing that required the use of assembly was that the get_cpu_ops_ptr() function was not PCS compliant and needed a wrapper to do that instead. That has now been fixed so move this to C so it's more readable and more optimise-able by the compiler.
Change-Id: I5fcfe8ddb122dd35d58adc6d44a7484c5c595815 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| c42aefd3 | 12-Aug-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpufeat): enable FEAT_MPAM_PE_BW_CTRL support
Implement support for FEAT_MPAM_PE_BW_CTRL, allowing lower Exception Levels to access MPAM_PE_BW_CTRL control registers by disabling their traps to
feat(cpufeat): enable FEAT_MPAM_PE_BW_CTRL support
Implement support for FEAT_MPAM_PE_BW_CTRL, allowing lower Exception Levels to access MPAM_PE_BW_CTRL control registers by disabling their traps to EL3.
When INIT_UNUSED_NS_EL2=1, configure MPAMBW2_EL2 in EL3 so that MPAM_PE_BW_CTRL accesses from EL0/EL1 do not trap to EL2.
At this stage, PE-side MPAM bandwidth controls remain disabled in EL3.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I8e359b0eb912cff3bdda109b21727a627cac3a7e
show more ...
|
| ea5a4e98 | 11-Apr-2025 |
Saivardhan Thatikonda <saivardhan.thatikonda@amd.com> |
fix(cm): use safe casting in memcpy
This corrects the MISRA violation C2012-21.15: Both gp_regs and ep->args were cast to the correct pointer types to avoid incompatible argument types in memcpy().
fix(cm): use safe casting in memcpy
This corrects the MISRA violation C2012-21.15: Both gp_regs and ep->args were cast to the correct pointer types to avoid incompatible argument types in memcpy(). This fix ensures type compatibility and adheres to MISRA 21.15, which disallows implicit casting between unrelated types
Change-Id: Iad1d78574e423b46934a5978bdcbe2d5fb78e910 Signed-off-by: Saivardhan Thatikonda <saivardhan.thatikonda@amd.com>
show more ...
|
| 985b6a6b | 17-Jul-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cm): disable SPE/TRBE correctly
SPE and TRBE are unusual features. They have multi-bit enables whose function is not immediately apparent and disabling them is not straightforward.
While attemp
fix(cm): disable SPE/TRBE correctly
SPE and TRBE are unusual features. They have multi-bit enables whose function is not immediately apparent and disabling them is not straightforward.
While attempting to figure this out, the disables were made a mess of. Patch fc7dca72b began changing the owning security state of SPE and TRBE. This was first used in patch 79c0c7fac0 with calls to spe_disable() and trbe_disbale(). However, patch 13f4a2525 reverted the security state ownership, making the spe_disable() and trbe_disable() redundant and their comments incorrect - the DoS protection is achieved by the psb/tsb barriers on context switch, introduces separately in f80887337 and 73d98e375.
Those patches got the behaviour full circle to what it was in fc7dca72b so the disables can be fully removed for clarity.
However, the original method for disabling these features is not fully correct - letting the "disabled" state be all zeroes made the features seem enabled for secure world but they would trap. That is not a problem while secure world doesn't use them, but could lead to some confusing debugging in the future. NS and Realm worlds were not affected. This patch fully establishes the pattern for SPE and TRBE's enablement, documents it, and implements it such.
The description comments in the features boil down to 2 rules. There is a third rule possible: 3. To enable TRBE/SPE for world X with a dirty buffer: * world X owns the buffer * trapping enabled This is not listed as it would not work correctly with SMCCC_ARCH_FEATURE_AVAILABILITY which relies on trapping to be disabled to report correctly. If that is ever implemented, the SMCCC implementation should be considered too.
Change-Id: I5588a3d5fc074c2445470954d8c3b172bec77d43 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 284c01c6 | 04-Mar-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cm): unify RMM context
setup_realm_context() is the de facto place to put any code that relates to the RMM's context. It is frequently updated and contains the vast majority of code. manage
refactor(cm): unify RMM context
setup_realm_context() is the de facto place to put any code that relates to the RMM's context. It is frequently updated and contains the vast majority of code. manage_extensions_realm() on the other hand is out of date and obscure.
So absorb manage_extensions_realm() and rmm_el2_context_init() into setup_realm_context().
We can also combine the write to sctlr_el2 for all worlds as they should all observe the RES1 values.
Finally, the SPSR_EL2.PAN comment in the realm copy is updated.
Change-Id: I21dccad0c13301e3249db6f6e292beb5d853563e Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 4274b526 | 23-Jun-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpufeat): add support for FEAT_FGWTE3
Enable write traps for key EL3 system registers as per FEAT_FGWTE3, ensuring their values remain unchanged after boot.
Excluded Registers: MDCR_EL3 and MP
feat(cpufeat): add support for FEAT_FGWTE3
Enable write traps for key EL3 system registers as per FEAT_FGWTE3, ensuring their values remain unchanged after boot.
Excluded Registers: MDCR_EL3 and MPAM3_EL3: Not trapped as they are part of the EL3 context. SCTLR_EL3: Not trapped since it is overwritten during powerdown sequence(Included when HW_ASSISTED_COHERENCY=1)
TPIDR_EL3: Excluded due to its use in crash reporting(It is included when CRASH_REPORTING=0)
Reference: https://developer.arm.com/documentation/ddi0601/2025-06/AArch64-Registers/FGWTE3-EL3--Fine-Grained-Write-Traps-EL3
Change-Id: Idcb32aaac7d65a0b0e5c90571af00e01a4e9edb1 Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
show more ...
|
| f05b4894 | 24-Apr-2024 |
Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com> |
fix(el3-runtime): typecast operands to match data type
This corrects the MISRA violation C2012-10.3: The value of an expression shall not be assigned to an object with a narrower essential type or o
fix(el3-runtime): typecast operands to match data type
This corrects the MISRA violation C2012-10.3: The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category. Replaced usage of 'unsigned int' with 'size_t' to ensure type consistency and prevent assignment to a narrower or different essential type.
Change-Id: I79501e216a04753ebd005d64375357b9332440d9 Signed-off-by: Nithin G <nithing@amd.com> Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
show more ...
|
| 6eafc060 | 04-Mar-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cm): gather per-world context management to the same place
The per-world calls are disparate - they get called in different places, are guarded in different ways, and the code is apart.
Si
refactor(cm): gather per-world context management to the same place
The per-world calls are disparate - they get called in different places, are guarded in different ways, and the code is apart.
Since they just need to be called once at boot, add a function that we can call from BL31 and be done with it.
Change-Id: Id0ade302e35f2b00ca37c552a53038942ab7b58e Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| e493b522 | 19-Jun-2025 |
Manish Pandey <manish.pandey2@arm.com> |
Merge "perf(bl31): convert cpu_data fetching to C" into integration |
| d43b2ea6 | 18-Mar-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(bl31): convert cpu_data fetching to C
The assembly routines are opaque to the compiler and it can't inline them. There is also no requirement for them to be called without a stack - each of the
perf(bl31): convert cpu_data fetching to C
The assembly routines are opaque to the compiler and it can't inline them. There is also no requirement for them to be called without a stack - each of their calls has a stack available. So convert them to C so that the compiler can do its inlining magic.
On AArch32 we need to be able to call _cpu_data from the entrypoint so it has to stay as a slight exception.
We can also straighten out the type of the cpu_ops_ptr member so we don't have to cast it everywhere.
Change-Id: I9c2939a955b396edf26b99ef36318eebeaab13e6 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| a3effe0a | 10-Jun-2025 |
Javier Almansa Sobrino <javier.almansasobrino@arm.com> |
fix(rme): enable support for FEAT_D128 on Realm world
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com> Change-Id: I9a4431038968a260e1a4998d8a4f84a07768db74 |
| 600717fe | 17-Apr-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cm): don't access a field that doesn't exist
We save memory in the context struct by not defining certain fields. But the feat_state accessors do not compile the code out, merely optimise it awa
fix(cm): don't access a field that doesn't exist
We save memory in the context struct by not defining certain fields. But the feat_state accessors do not compile the code out, merely optimise it away later. Without an explicit #if compilation fails. Add it back.
Change-Id: I98a11abe357d2be4f5628495731c3aec45b1148c Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| ee656609 | 16-Apr-2025 |
André Przywara <andre.przywara@arm.com> |
Merge changes Id942c20c,Idd286bea,I8917a26e,Iec8c3477,If3c25dcd, ... into integration
* changes: feat(cpufeat): enable FEAT_PAuth to FEAT_STATE_CHECKED perf(cpufeat): centralise PAuth key saving
Merge changes Id942c20c,Idd286bea,I8917a26e,Iec8c3477,If3c25dcd, ... into integration
* changes: feat(cpufeat): enable FEAT_PAuth to FEAT_STATE_CHECKED perf(cpufeat): centralise PAuth key saving refactor(cpufeat): convert FEAT_PAuth setup to C refactor(cpufeat): prepare FEAT_PAuth for FEATURE_DETECTION chore(cpufeat): remove PAuth presence checks feat(cpufeat): enable FEAT_BTI to FEAT_STATE_CHECKED
show more ...
|
| 8d9f5f25 | 02-Apr-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
feat(cpufeat): enable FEAT_PAuth to FEAT_STATE_CHECKED
FEAT_PAuth is the second to last feature to be a boolean choice - it's either unconditionally compiled in and must be present in hardware or it
feat(cpufeat): enable FEAT_PAuth to FEAT_STATE_CHECKED
FEAT_PAuth is the second to last feature to be a boolean choice - it's either unconditionally compiled in and must be present in hardware or it's not compiled in. FEAT_PAuth is architected to be backwards compatible - a subset of the branch guarding instructions (pacia/autia) execute as NOPs when PAuth is not present. That subset is used with `-mbranch-protection=standard` and -march pre-8.3. This patch adds the necessary logic to also check accesses of the non-backward compatible registers and allow a fully checked implementation.
Note that a checked support requires -march to be pre 8.3, as otherwise the compiler will include branch protection instructions that are not NOPs without PAuth (eg retaa) which cannot be checked.
Change-Id: Id942c20cae9d15d25b3d72b8161333642574ddaa Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 51997e3d | 02-Apr-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(cpufeat): centralise PAuth key saving
prepare_el3_entry() is meant to be the one-stop shop for all the context we must fiddle with to enter EL3 proper. However, PAuth is the one exception, happ
perf(cpufeat): centralise PAuth key saving
prepare_el3_entry() is meant to be the one-stop shop for all the context we must fiddle with to enter EL3 proper. However, PAuth is the one exception, happening right after. Absorb it into prepare_el3_entry(), handling the BL1/BL31 difference.
This is a good time to also move the key saving into the enable function, also to centralise. With this it becomes apparent that saving keys just before CPU_SUSPEND is redundant as they will be reinitialised when the core wakes up.
Note that the key loading, now in save_gp_pmcr_pauth_regs, does not end in an isb. The effects of the key change are not needed until the isb in the caller, so this isb is not needed.
Change-Id: Idd286bea91140c106ab4c933c5c44b0bc2050ca2 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| f8138056 | 02-Apr-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpufeat): convert FEAT_PAuth setup to C
An oversimplified view of FEAT_PAuth is that it's a symmetric encryption of the LR. PAC instructions execute as NOPs until explicitly turned on. So i
refactor(cpufeat): convert FEAT_PAuth setup to C
An oversimplified view of FEAT_PAuth is that it's a symmetric encryption of the LR. PAC instructions execute as NOPs until explicitly turned on. So in a function that turns PAuth on, the signing would have executed as a NOP and the authentication will encrypt the address, leading to a failure. That's why enablement is in assembly - we have full control of when pointer authentications happen.
However, assembly is hard to read, is opaque to the compiler for optimisations, and we need to call into C anyway for the platform hook to get the key. So convert it to C. We can instruct the compiler to not generate branch protection for the enable function only and as long as the caller doesn't do branch protection (and all callers are entrypoints written in assembly) everything will work.
Change-Id: I8917a26e1293033c910e3058664e3ca9207359b7 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| b0b7609e | 01-Apr-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpufeat): prepare FEAT_PAuth for FEATURE_DETECTION
Convert the old style is_armv8_3_pauth_present() to the new style is_feat_pauth_{present, supported}() helpers and hook FEATURE_DETECTION
refactor(cpufeat): prepare FEAT_PAuth for FEATURE_DETECTION
Convert the old style is_armv8_3_pauth_present() to the new style is_feat_pauth_{present, supported}() helpers and hook FEATURE_DETECTION into it. This is in preparation for converting FEAT_PAuth to FEAT_STATE.
Change-Id: Iec8c3477fafb2cdae67d39ae4da2cca76a67511a Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| ef738d19 | 21-Jun-2024 |
Manish Pandey <manish.pandey2@arm.com> |
feat(psci): remove cpu context init by index
Currently, the calling core (meaning the core which received the call to CPU_ON or the powerdown path of CPU_SUSPEND on the same core) is in charge of in
feat(psci): remove cpu context init by index
Currently, the calling core (meaning the core which received the call to CPU_ON or the powerdown path of CPU_SUSPEND on the same core) is in charge of initialising the context for the waking core (the warmboot entrypoint for both). This is convenient because the calling core can write the context while in coherency and the waking core will only need the context after its entered coherency. This avoids any cache maintenance and makes communication simple.
However, this has 3 main problems: a) asymmetric feature support is problematic - the calling core has no way of knowing the feature set of the waking core. If the two diverge, the architectural feature discovery via ID registers breaks down. We've thus far "fixed" this on a case by case basis which doesn't scale and introduces redundancy.
b) powerdown abandon (pabandon) introduces a contradiction - the calling core has to initialise the context for when the core wakes up, but should the core not powerdown it needs its old context intact. The only way to work around this is by keeping two copies of context which incurs a runtime and memory overhead.
c) cm_prepare_el3_exit[_ns]() doesn't have access to the entrypoint but needs it to make initialisation decisions. We can infer some of this from registers that have already been written but this is awkwardly limiting for what we can do. This also necessitates the split from the context initialisation.
We can solve all three by a making a core be in full ownership of its own context. The calling core then only writes entrypoint information and nothing else. The waking core then initialises its own context as it sees fit with full knowledge of the whole picture.
The only tricky bit is cache coherency - the waking core has to be able to coherently observe its new entrypoint. Calling cores will write to the shared region with coherent caches on. If we make sure to read the context only after the waking core has entered coherency, then we can avoid cache operations and let hardware handle everything.
We can skip the spsr check for FEAT_TCR2 as it doesn't make a difference. We can also skip enabling it twice from generic code.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: I86e7fe8b698191fc3b469e5ced1fd010f8754b0e
show more ...
|
| 5141de14 | 16-Jan-2025 |
Per Larsen <perlarsen@google.com> |
fix(build): enable fp during fp save/restore
Newer compilers such as clang/LLVM 19 flag uses of floating point instructions when the architecture does not allow for it. We can temporarily enable the
fix(build): enable fp during fp save/restore
Newer compilers such as clang/LLVM 19 flag uses of floating point instructions when the architecture does not allow for it. We can temporarily enable the use of floating point operations where it it is safe and necessary for the build to succeed.
Change-Id: I1a832f846915c35792684906c94aef81c1f72d63 Signed-off-by: Andrei Homescu <ahomescu@google.com> Signed-off-by: Per Larsen <perlarsen@google.com>
show more ...
|
| 23775427 | 27-Mar-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge changes from topic "xlnx_fix_gen_datatype_cast" into integration
* changes: fix(psci): add const qualifier fix(el3-runtime): add const qualifier fix(bl31): add const qualifier fix(cons
Merge changes from topic "xlnx_fix_gen_datatype_cast" into integration
* changes: fix(psci): add const qualifier fix(el3-runtime): add const qualifier fix(bl31): add const qualifier fix(console): typecast expressions to match data type fix(arm-drivers): typecast expressions to match data type fix(arm-drivers): align essential type categories fix(arm-drivers): typecast expression to match data type
show more ...
|
| fa8ca8bc | 17-Mar-2025 |
Bipin Ravi <bipin.ravi@arm.com> |
Merge "fix(errata): workaround for Cortex-A510 erratum 2971420" into integration |
| f2bd3528 | 19-Feb-2025 |
John Powell <john.powell@arm.com> |
fix(errata): workaround for Cortex-A510 erratum 2971420
Cortex-A510 erratum 2971420 applies to revisions r0p1, r0p2, r0p3, r1p0, r1p1, r1p2 and r1p3, and is still open.
Under some conditions, data
fix(errata): workaround for Cortex-A510 erratum 2971420
Cortex-A510 erratum 2971420 applies to revisions r0p1, r0p2, r0p3, r1p0, r1p1, r1p2 and r1p3, and is still open.
Under some conditions, data might be corrupted if Trace Buffer Extension (TRBE) is enabled. The workaround is to disable trace collection via TRBE by programming MDCR_EL3.NSTB[1] to the opposite value of SCR_EL3.NS on a security state switch. Since we only enable TRBE for non-secure world, the workaround is to disable TRBE by setting the NSTB field to 00 so accesses are trapped to EL3 and secure state owns the buffer.
SDEN: https://developer.arm.com/documentation/SDEN-1873361/latest/
Signed-off-by: John Powell <john.powell@arm.com> Change-Id: Ia77051f6b64c726a8c50596c78f220d323ab7d97
show more ...
|
| 484befbf | 12-Mar-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
fix(cpufeat): add feat_hcx check before enabling FEAT_MOPS
This patch also checks for FEAT_HCX before enabling FEAT_MOPS when INIT_UNUSED_NS_EL1 = 1 and adds build dependency check.
Signed-off-by:
fix(cpufeat): add feat_hcx check before enabling FEAT_MOPS
This patch also checks for FEAT_HCX before enabling FEAT_MOPS when INIT_UNUSED_NS_EL1 = 1 and adds build dependency check.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: Iff4a068aa392fc8d29e2e4da7a2e7df0b3104e65
show more ...
|
| c5ea3fac | 12-Mar-2025 |
Soby Mathew <soby.mathew@arm.com> |
Merge "feat(rmmd): add FEAT_MEC support" into integration |