| fcf2ab71 | 11-Feb-2025 |
John Powell <john.powell@arm.com> |
fix(cpus): workaround for Cortex-A715 erratum 2804830
Cortex-A715 erratum 2804830 applies to r0p0, r1p0, r1p1 and r1p2, and is fixed in r1p3.
Under some conditions, writes of a 64B-aligned, 64B gra
fix(cpus): workaround for Cortex-A715 erratum 2804830
Cortex-A715 erratum 2804830 applies to r0p0, r1p0, r1p1 and r1p2, and is fixed in r1p3.
Under some conditions, writes of a 64B-aligned, 64B granule of memory might cause data corruption without this workaround. See SDEN for details.
Since this workaround disables write streaming, it is expected to have a significant performance impact for code that is heavily reliant on write streaming, such as memcpy or memset.
SDEN: https://developer.arm.com/documentation/SDEN-2148827/latest/
Change-Id: Ia12f6c7de7c92f6ea4aec3057b228b828d48724c Signed-off-by: John Powell <john.powell@arm.com>
show more ...
|
| bbff267b | 24-Feb-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
fix(errata-abi): add support for handling split workarounds
Certain erratum workarounds like Neoverse N1 1542419, need a part of their mitigation done in EL3 and the rest in lower EL. But currently
fix(errata-abi): add support for handling split workarounds
Certain erratum workarounds like Neoverse N1 1542419, need a part of their mitigation done in EL3 and the rest in lower EL. But currently such workarounds return HIGHER_EL_MITIGATION which indicates that the erratum has already been mitigated by a higher EL(EL3 in this case) which causes the lower EL to not apply it's part of the mitigation.
This patch fixes this issue by adding support for split workarounds so that on certain errata we return AFFECTED even though EL3 has applied it's workaround. This is done by reusing the chosen field of erratum_entry structure into a bitfield that has two bitfields - Bit 0 indicates that the erratum has been enabled in build, Bit 1 indicates that the erratum is a split workaround and should return AFFECTED instead of HIGHER_EL_MITIGATION.
SDEN documentation: https://developer.arm.com/documentation/SDEN885747/latest
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: Iec94d665b5f55609507a219a7d1771eb75e7f4a7
show more ...
|
| 98c65165 | 26-Feb-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
chore: rename arcadia to Cortex-A320
Cortex-A320 has been announced, rename arcadia to Cortex-A320.
Ref: https://newsroom.arm.com/blog/introducing-arm-cortex-a320-cpu https://www.arm.com/products/s
chore: rename arcadia to Cortex-A320
Cortex-A320 has been announced, rename arcadia to Cortex-A320.
Ref: https://newsroom.arm.com/blog/introducing-arm-cortex-a320-cpu https://www.arm.com/products/silicon-ip-cpu/cortex-a/cortex-a320
Change-Id: Ifb3743d43dca3d8caaf1e7416715ccca4fdf195f Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 2590e819 | 25-Nov-2024 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(mpmm): greatly simplify MPMM enablement
MPMM is a core-specific microarchitectural feature. It has been present in every Arm core since the Cortex-A510 and has been implemented in exactly the s
perf(mpmm): greatly simplify MPMM enablement
MPMM is a core-specific microarchitectural feature. It has been present in every Arm core since the Cortex-A510 and has been implemented in exactly the same way. Despite that, it is enabled more like an architectural feature with a top level enable flag. This utilised the identical implementation.
This duality has left MPMM in an awkward place, where its enablement should be generic, like an architectural feature, but since it is not, it should also be core-specific if it ever changes. One choice to do this has been through the device tree.
This has worked just fine so far, however, recent implementations expose a weakness in that this is rather slow - the device tree has to be read, there's a long call stack of functions with many branches, and system registers are read. In the hot path of PSCI CPU powerdown, this has a significant and measurable impact. Besides it being a rather large amount of code that is difficult to understand.
Since MPMM is a microarchitectural feature, its correct placement is in the reset function. The essence of the current enablement is to write CPUPPMCR_EL3.MPMM_EN if CPUPPMCR_EL3.MPMMPINCTL == 0. Replacing the C enablement with an assembly macro in each CPU's reset function achieves the same effect with just a single close branch and a grand total of 6 instructions (versus the old 2 branches and 32 instructions).
Having done this, the device tree entry becomes redundant. Should a core that doesn't support MPMM arise, this can cleanly be handled in the reset function. As such, the whole ENABLE_MPMM_FCONF and platform hooks mechanisms become obsolete and are removed.
Change-Id: I1d0475b21a1625bb3519f513ba109284f973ffdf Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 21d068be | 24-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpus): declare runtime errata correctly
There errata don't have a workaround in the cpu file. So calling the wrappers is redundant. We can simply register them with the framework.
Change-I
refactor(cpus): declare runtime errata correctly
There errata don't have a workaround in the cpu file. So calling the wrappers is redundant. We can simply register them with the framework.
Change-Id: I316daeee603e86c9f2bdccf91e1b10f7ec6c3f9d Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 89dba82d | 22-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(cpus): make reset errata do fewer branches
Errata application is painful for performance. For a start, it's done when the core has just come out of reset, which means branch predictors and cach
perf(cpus): make reset errata do fewer branches
Errata application is painful for performance. For a start, it's done when the core has just come out of reset, which means branch predictors and caches will be empty so a branch to a workaround function must be fetched from memory and that round trip is very slow. Then it also runs with the I-cache off, which means that the loop to iterate over the workarounds must also be fetched from memory on each iteration.
We can remove both branches. First, we can simply apply every erratum directly instead of defining a workaround function and jumping to it. Currently, no errata that need to be applied at both reset and runtime, with the same workaround function, exist. If the need arose in future, this should be achievable with a reset + runtime wrapper combo.
Then, we can construct a function that applies each erratum linearly instead of looping over the list. If this function is part of the reset function, then the only "far" branches at reset will be for the checker functions. Importantly, this mitigates the slowdown even when an erratum is disabled.
The result is ~50% speedup on N1SDP and ~20% on AArch64 Juno on wakeup from PSCI calls that end in powerdown. This is roughly back to the baseline of v2.9, before the errata framework regressed on performance (or a little better). It is important to note that there are other slowdowns since then that remain unknown.
Change-Id: Ie4d5288a331b11fd648e5c4a0b652b74160b07b9 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 0d020822 | 19-Nov-2024 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(cpus): inline the reset function
Similar to the cpu_rev_var and cpu_ger_rev_var functions, inline the call_reset_handler handler. This way we skip the costly branch at no extra cost as this is
perf(cpus): inline the reset function
Similar to the cpu_rev_var and cpu_ger_rev_var functions, inline the call_reset_handler handler. This way we skip the costly branch at no extra cost as this is the only place where this is called.
While we're at it, drop the options for CPU_NO_RESET_FUNC. The only cpus that need that are virtual cpus which can spare the tiny bit of performance lost. The rest are real cores which can save on the check for zero.
Now is a good time to put the assert for a missing cpu in the get_cpu_ops_ptr function so that it's a bit better encapsulated.
Change-Id: Ia7c3dcd13b75e5d7c8bafad4698994ea65f42406 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 36eeb59f | 04-Dec-2024 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(cpus): inline the cpu_get_rev_var call
Similar to the cpu_rev_var_xy functions, branching far away so early in the reset sequence incurs significant slowdowns. Inline the function.
Change-Id:
perf(cpus): inline the cpu_get_rev_var call
Similar to the cpu_rev_var_xy functions, branching far away so early in the reset sequence incurs significant slowdowns. Inline the function.
Change-Id: Ifc349015902cd803e11a1946208141bfe7606b89 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 7791ce21 | 21-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
perf(cpus): inline cpu_rev_var checks
We strive to apply errata as close to reset as possible with as few things enabled as possible. Importantly, the I-cache will not be enabled. This means that re
perf(cpus): inline cpu_rev_var checks
We strive to apply errata as close to reset as possible with as few things enabled as possible. Importantly, the I-cache will not be enabled. This means that repeated branches to these tiny functions must be re-fetched all the way from memory each time which has glacial speed. Cores are allowed to fetch things ahead of time though as long as execution is fairly linear. So we can trade a little bit of space (3 to 7 instructions per erratum) to keep things linear and not have to go to memory.
While we're at it, optimise the the cpu_rev_var_{ls, hs, range} functions to take up less space. Dropping the moves allows for a bit of assembly magic that produces the same result in 2 and 3 instructions respectively.
Change-Id: I51608352f23b2244ea7a99e76c10892d257f12bf Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| b62673c6 | 23-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpus): register DSU errata with the errata framework's wrappers
The existing DSU errata workarounds hijack the errata framework's inner workings to register with it. However, that is undesi
refactor(cpus): register DSU errata with the errata framework's wrappers
The existing DSU errata workarounds hijack the errata framework's inner workings to register with it. However, that is undesirable as any change to the framework may end up missing these workarounds. So convert the checks and workarounds to macros and have them included with the standard wrappers.
The only problem with this is the is_scu_present_in_dsu weak function. Fortunately, it is only needed for 2 of the errata and only on 3 cores. So drop it, assuming the default behaviour and have the callers handle the exception.
Change-Id: Iefa36325804ea093e938f867b9a6f49a6984b8ae Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| b5477167 | 21-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpus): convert checker functions to standard helpers
The library check_erratum_ls already incorporates the check. The return of ERRATA_MISSING is handled in the errata_report.c functions.
refactor(cpus): convert checker functions to standard helpers
The library check_erratum_ls already incorporates the check. The return of ERRATA_MISSING is handled in the errata_report.c functions.
Change-Id: Ic1dff2bc5235195f7cfce1709cd42467f88b3e4c Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 52e89e9e | 23-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpus): convert the Cortex-A65 to use the errata framework
Result was verified by manually stepping through the reset function with a debugger.
Change-Id: I91cd6111ccf95d6b7ee2364ac2126cb98
refactor(cpus): convert the Cortex-A65 to use the errata framework
Result was verified by manually stepping through the reset function with a debugger.
Change-Id: I91cd6111ccf95d6b7ee2364ac2126cb98ee4bb15 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 5cba510e | 20-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cpus): declare reset errata correctly
The errata in this patch are declared as runtime, but are never called explicitly. This means that they are never called! Convert them to reset errata so th
fix(cpus): declare reset errata correctly
The errata in this patch are declared as runtime, but are never called explicitly. This means that they are never called! Convert them to reset errata so that they are called at reset. Their SDENs entries have been checked and confirm that this is how they should be implemented.
Also, drop the the MIDR check on the a57 erratum as it's not needed - the erratum is already called from a cpu-specific function.
Change-Id: I22c3043ab454ce94b3c122c856e5804bc2ebb18b Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| 29bda258 | 07-Feb-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Cortex-X925 erratum 2963999
Cortex-X925 erratum 2963999 that applies to r0p0 and is fixed in r0p1.
In EL3, reads of MPIDR_EL1 and MIDR_EL1 might incorrectly virtualize whi
fix(cpus): workaround for Cortex-X925 erratum 2963999
Cortex-X925 erratum 2963999 that applies to r0p0 and is fixed in r0p1.
In EL3, reads of MPIDR_EL1 and MIDR_EL1 might incorrectly virtualize which register to return when reading the value of MPIDR_EL1/VMPIDR_EL2 and MIDR_EL1/VPIDR_EL2, respectively.
The workaround is to do an ISB prior to an MRS read to either MPIDR_EL1 and MIDR_EL1.
SDEN documentation: https://developer.arm.com/documentation/109180/latest/
Change-Id: I447fd359ea32e1d274e1245886e1de57d14f082c Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 5f32fd21 | 07-Feb-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Neoverse-V3 erratum 2970647
Neoverse V3 erratum 2970647 that applies to r0p0 and is fixed in r0p1.
In EL3, reads of MPIDR_EL1 and MIDR_EL1 might incorrectly virtualize whi
fix(cpus): workaround for Neoverse-V3 erratum 2970647
Neoverse V3 erratum 2970647 that applies to r0p0 and is fixed in r0p1.
In EL3, reads of MPIDR_EL1 and MIDR_EL1 might incorrectly virtualize which register to return when reading the value of MPIDR_EL1/VMPIDR_EL2 and MIDR_EL1/VPIDR_EL2, respectively.
The workaround is to do an ISB prior to an MRS read to either MPIDR_EL1 and MIDR_EL1.
SDEN documentation: https://developer.arm.com/documentation/SDEN-2891958/latest/
Change-Id: Iedf7d799451f0be58a5da1f93f7f5b6940f2bb35 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 09c1edb8 | 07-Feb-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Cortex-X4 erratum 2957258
Cortex-X4 erratum 2957258 that applies to r0p0, r0p1 and is fixed in r0p2.
In EL3, reads of MPIDR_EL1 and MIDR_EL1 might incorrectly virtualize w
fix(cpus): workaround for Cortex-X4 erratum 2957258
Cortex-X4 erratum 2957258 that applies to r0p0, r0p1 and is fixed in r0p2.
In EL3, reads of MPIDR_EL1 and MIDR_EL1 might incorrectly virtualize which register to return when reading the value of MPIDR_EL1/VMPIDR_EL2 and MIDR_EL1/VPIDR_EL2, respectively.
The workaround is to do an ISB prior to an MRS read to either MPIDR_EL1 and MIDR_EL1.
SDEN documentation: https://developer.arm.com/documentation/109148/latest/
Change-Id: I2d8e7f4ce19ca2e1d87527c31e7778d81aff0279 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| fcb80d7d | 11-Feb-2025 |
Manish Pandey <manish.pandey2@arm.com> |
Merge changes I765a7fa0,Ic33f0b6d,I8d1a88c7,I381f96be,I698fa849, ... into integration
* changes: fix(cpus): clear CPUPWRCTLR_EL1.CORE_PWRDN_EN_BIT on reset chore(docs): drop the "wfi" from `pwr_
Merge changes I765a7fa0,Ic33f0b6d,I8d1a88c7,I381f96be,I698fa849, ... into integration
* changes: fix(cpus): clear CPUPWRCTLR_EL1.CORE_PWRDN_EN_BIT on reset chore(docs): drop the "wfi" from `pwr_domain_pwr_down_wfi` chore(psci): drop skip_wfi variable feat(arm): convert arm platforms to expect a wakeup fix(cpus): avoid SME related loss of context on powerdown feat(psci): allow cores to wake up from powerdown refactor: panic after calling psci_power_down_wfi() refactor(cpus): undo errata mitigations feat(cpus): add sysreg_bit_toggle
show more ...
|
| 593ae354 | 22-Mar-2023 |
Boyan Karatotev <boyan.karatotev@arm.com> |
feat(cpus): add ENABLE_ERRATA_ALL flag
Now that all errata flags are all conveniently in a single list we can make sweeping decisions about their values. The first use-case is to enable all errata i
feat(cpus): add ENABLE_ERRATA_ALL flag
Now that all errata flags are all conveniently in a single list we can make sweeping decisions about their values. The first use-case is to enable all errata in TF-A. This is useful for CI runs where it is impractical to list every single one. This should help with the long standing issue of errata not being built or tested.
Also add missing CPUs with errata to `ENABLE_ERRATA_ALL` to enable all errata builds in CI.
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com> Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Change-Id: I2b456d304d7bf3215c7c4f4fd70b56ecbcb09979
show more ...
|
| c9f352c3 | 16-Oct-2024 |
Boyan Karatotev <boyan.karatotev@arm.com> |
fix(cpus): clear CPUPWRCTLR_EL1.CORE_PWRDN_EN_BIT on reset
The model has a bug where it will not clear CPUPWRCTLR_EL1 on reset, even though the actual cores do. The write of 1 to the bit itself trig
fix(cpus): clear CPUPWRCTLR_EL1.CORE_PWRDN_EN_BIT on reset
The model has a bug where it will not clear CPUPWRCTLR_EL1 on reset, even though the actual cores do. The write of 1 to the bit itself triggers the powerdown sequnece, regardless of the value before the write. As such, the bug does not impact functionality but it does throw off software reading it.
Clear the bit on Travis and Gelas as they are the only ones to require reading it back.
Change-Id: I765a7fa055733d522480be30d412e3b417af2bd7 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| e25fc9df | 22-Jan-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Neoverse-V3 erratum 3701767
Neoverse-V3 erratum 3701767 that applies to r0p0, r0p1, r0p2 is still Open.
The workaround is for EL3 software that performs context save/resto
fix(cpus): workaround for Neoverse-V3 erratum 3701767
Neoverse-V3 erratum 3701767 that applies to r0p0, r0p1, r0p2 is still Open.
The workaround is for EL3 software that performs context save/restore on a change of Security state to use a value of SCR_EL3.NS when accessing ICH_VMCR_EL2 that reflects the Security state that owns the data being saved or restored.
SDEN documentation: https://developer.arm.com/documentation/SDEN-2891958/latest/
Change-Id: I5be0de881f408a9e82a07b8459d79490e9065f94 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| fded8392 | 22-Jan-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Neoverse-N3 erratum 3699563
Neoverse-N3 erratum 3699563 that applies to r0p0 is still Open.
The workaround is for EL3 software that performs context save/restore on a chan
fix(cpus): workaround for Neoverse-N3 erratum 3699563
Neoverse-N3 erratum 3699563 that applies to r0p0 is still Open.
The workaround is for EL3 software that performs context save/restore on a change of Security state to use a value of SCR_EL3.NS when accessing ICH_VMCR_EL2 that reflects the Security state that owns the data being saved or restored.
SDEN documentation: https://developer.arm.com/documentation/SDEN-3050973/latest/
Change-Id: I77aaf8ae0afff3adde9a85f4a1a13ac9d1daf0af Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| adea6e52 | 22-Jan-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Neoverse-N2 erratum 3701773
Neoverse-N2 erratum 3701773 that applies to r0p0, r0p1, r0p2 and r0p3 is still Open.
The workaround is for EL3 software that performs context s
fix(cpus): workaround for Neoverse-N2 erratum 3701773
Neoverse-N2 erratum 3701773 that applies to r0p0, r0p1, r0p2 and r0p3 is still Open.
The workaround is for EL3 software that performs context save/restore on a change of Security state to use a value of SCR_EL3.NS when accessing ICH_VMCR_EL2 that reflects the Security state that owns the data being saved or restored.
SDEN documentation: https://developer.arm.com/documentation/SDEN-1982442/latest/
Change-Id: If95bd67363228c8083724b31f630636fb27f3b61 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 511148ef | 22-Jan-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Cortex-X925 erratum 3701747
Cortex-X925 erratum 3701747 that applies to r0p0, r0p1 and is still Open.
The workaround is for EL3 software that performs context save/restore
fix(cpus): workaround for Cortex-X925 erratum 3701747
Cortex-X925 erratum 3701747 that applies to r0p0, r0p1 and is still Open.
The workaround is for EL3 software that performs context save/restore on a change of Security state to use a value of SCR_EL3.NS when accessing ICH_VMCR_EL2 that reflects the Security state that owns the data being saved or restored.
SDEN documentation: https://developer.arm.com/documentation/109180/latest/
Change-Id: I080296666f89276b3260686c2bdb8de63fc174c1 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 38401c53 | 22-Jan-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Cortex-X4 erratum 3701758
Cortex-X4 erratum 3701758 that applies to r0p0, r0p1, r0p2 and r0p3 is still Open.
The workaround is for EL3 software that performs context save/
fix(cpus): workaround for Cortex-X4 erratum 3701758
Cortex-X4 erratum 3701758 that applies to r0p0, r0p1, r0p2 and r0p3 is still Open.
The workaround is for EL3 software that performs context save/restore on a change of Security state to use a value of SCR_EL3.NS when accessing ICH_VMCR_EL2 that reflects the Security state that owns the data being saved or restored.
SDEN documentation: https://developer.arm.com/documentation/109148/latest/
Change-Id: I4ee941d1e7653de7a12d69f538ca05f7f9f9961d Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| 77feb745 | 22-Jan-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): workaround for Cortex-X3 erratum 3701769
Cortex-X3 erratum 3701769 that applies to r0p0, r1p0, r1p1 and r1p2 is still Open.
The workaround is for EL3 software that performs context save/
fix(cpus): workaround for Cortex-X3 erratum 3701769
Cortex-X3 erratum 3701769 that applies to r0p0, r1p0, r1p1 and r1p2 is still Open.
The workaround is for EL3 software that performs context save/restore on a change of Security state to use a value of SCR_EL3.NS when accessing ICH_VMCR_EL2 that reflects the Security state that owns the data being saved or restored.
SDEN documentation: https://developer.arm.com/documentation/SDEN-2055130/latest/
Change-Id: Ifd722e1bb8616ada2ad158297a7ca80b19a3370b Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|