| #
35b2bbf4 |
| 28-Jul-2025 |
Manish Pandey <manish.pandey2@arm.com> |
Merge changes from topic "bk/pabandon_cleanup" into integration
* changes: feat(cpus): add pabandon support to the Alto cpu feat(psci): optimise clock init on a pabandon feat(psci): check that
Merge changes from topic "bk/pabandon_cleanup" into integration
* changes: feat(cpus): add pabandon support to the Alto cpu feat(psci): optimise clock init on a pabandon feat(psci): check that CPUs handled a pabandon feat(psci): make pabandon support generic refactor(psci): unify coherency exit between AArch64 and AArch32 refactor(psci): absorb psci_power_down_wfi() into common code refactor(platforms): remove usage of psci_power_down_wfi fix(cm): disable SPE/TRBE correctly
show more ...
|
| #
461b62b5 |
| 25-Mar-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
feat(psci): check that CPUs handled a pabandon
Up to now PSCI assumed that if a pabandon happened then the CPU driver will have handled it. This patch adds a simple protocol to make sure that this i
feat(psci): check that CPUs handled a pabandon
Up to now PSCI assumed that if a pabandon happened then the CPU driver will have handled it. This patch adds a simple protocol to make sure that this is indeed the case. The chosen method is with a return value that is highly unlikely on cores that are unaware of pabandon (x0 will be primed with 1 and if used should be overwritten with the value of CPUPWRCTLR_EL1 which should have its last bit set to power off and its top bits RES0; the ACK value is chosen to be the exact opposite). An alternative method would have been to add a field in cpu_ops, however that would have required more major refactoring across many cpus and would have taken up more memory on older platforms, so it was not chosen.
Change-Id: I5826c0e4802e104d295c4ecbd80b5f676d2cd871 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| #
91091434 |
| 05-Jun-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge "feat(cpus): update cpu_check_csv2 check" into integration
|
| #
2b432165 |
| 02-Jun-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
feat(cpus): update cpu_check_csv2 check
Update the cpu_check_csv2 logic to allow ID_AA64PFR0_EL1.CSV2 values up to 3. With the introduction of FEAT_CSV2_3, the architectural limit for CSV2 has been
feat(cpus): update cpu_check_csv2 check
Update the cpu_check_csv2 logic to allow ID_AA64PFR0_EL1.CSV2 values up to 3. With the introduction of FEAT_CSV2_3, the architectural limit for CSV2 has been extended, making values from 0 to 3 valid.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I8473047ed4ad759b7b506161a76774ac21555d31
show more ...
|
| #
b1e1f42e |
| 25-Apr-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge changes I005586ef,I0d4d74bc into integration
* changes: fix(cpufeat): replace "bti" mnemonic with hint instructions fix(cpufeat): improve xpaci wrapper
|
| #
bdac600b |
| 15-Apr-2025 |
Andre Przywara <andre.przywara@arm.com> |
fix(cpufeat): replace "bti" mnemonic with hint instructions
Older GNU binutils version require to specify at least "armv8.5-a" for the ARM architecture revision to accept "bti" instructions in the a
fix(cpufeat): replace "bti" mnemonic with hint instructions
Older GNU binutils version require to specify at least "armv8.5-a" for the ARM architecture revision to accept "bti" instructions in the assembly code. Binutils v2.35 have relaxed this, since "bti" is in the hint space, so is ignored on older cores and does NOT require a BTI enabled core to execute.
To not exclude those older binutils versions (as shipped with Ubuntu 20.04), use the "hint" encoding for the "bti" instructions, which are accepted regardless of the minimum architecture revision. Hide this encoding in a macro, to make the "bti" usage more readable in the source code.
Change-Id: I005586efd8974a3f2c7202896c881bb5fed07eea Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| #
a6e01071 |
| 24-Apr-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge changes from topic "ar/cve_wa_refactor" into integration
* changes: refactor(cpus): optimize CVE checking refactor(cpus): move errata check to common code refactor(cpus): drop unused arg
Merge changes from topic "ar/cve_wa_refactor" into integration
* changes: refactor(cpus): optimize CVE checking refactor(cpus): move errata check to common code refactor(cpus): drop unused argument forward_flag
show more ...
|
| #
fd04156e |
| 04-Apr-2025 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
refactor(cpus): optimize CVE checking
This patch replaces the use of EXTRA functions with using erratum entries check to verify CVE mitigation application for some of the SMCCC_ARCH_WORKAROUND_* cal
refactor(cpus): optimize CVE checking
This patch replaces the use of EXTRA functions with using erratum entries check to verify CVE mitigation application for some of the SMCCC_ARCH_WORKAROUND_* calls.
Previously, EXTRA functions were individually implemented for each SMCCC_ARCH_WORKAROUND_*, an approach that becomes unmanageable with the increasing number of workarounds. By looking up erratum entries for CVE check, the process is streamlined, reducing overhead associated with creating and maintaining EXTRA functions for each new workaround.
New Errata entries are created for SMC workarounds and that is used to target cpus that are uniquely impacted by SMC workarounds.
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I873534e367a35c99461d0a616ff7bf856a0000af
show more ...
|
| #
0bc28513 |
| 08-Apr-2025 |
Bipin Ravi <bipin.ravi@arm.com> |
Merge "fix(cpus): fix clang compilation issue" into integration
|
| #
bdaf0d9b |
| 03-Apr-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
fix(cpus): fix clang compilation issue
A potential problem with clang version < 17 can cause resolving nested 'cfi_startproc' to fail compilation.
So add a variant of check_errara/reset_macros that
fix(cpus): fix clang compilation issue
A potential problem with clang version < 17 can cause resolving nested 'cfi_startproc' to fail compilation.
So add a variant of check_errara/reset_macros that is compatible with clang version < 17 to ignore `cfi_startproc` and `cfi_endproc`.
This wouldn't cause any performance issue and will not affect any functional behaviour.
Change-Id: I46147af2dd0accd5be14ddb26dea03bb2f87cba8 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
show more ...
|
| #
98a7cdb2 |
| 07-Mar-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge "fix(errata-abi): add support for handling split workarounds" into integration
|
| #
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 ...
|
| #
2e0354f5 |
| 25-Feb-2025 |
Manish V Badarkhe <manish.badarkhe@arm.com> |
Merge changes I3d950e72,Id315a8fe,Ib62e6e9b,I1d0475b2 into integration
* changes: perf(cm): drop ZCR_EL3 saving and some ISBs and replace them with root context perf(psci): get PMF timestamps wi
Merge changes I3d950e72,Id315a8fe,Ib62e6e9b,I1d0475b2 into integration
* changes: perf(cm): drop ZCR_EL3 saving and some ISBs and replace them with root context perf(psci): get PMF timestamps with no cache flushes if possible perf(amu): greatly simplify AMU context management perf(mpmm): greatly simplify MPMM enablement
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 ...
|
| #
a8a5d39d |
| 24-Feb-2025 |
Manish V Badarkhe <manish.badarkhe@arm.com> |
Merge changes from topic "bk/errata_speed" into integration
* changes: refactor(cpus): declare runtime errata correctly perf(cpus): make reset errata do fewer branches perf(cpus): inline the i
Merge changes from topic "bk/errata_speed" into integration
* changes: refactor(cpus): declare runtime errata correctly perf(cpus): make reset errata do fewer branches perf(cpus): inline the init_cpu_data_ptr function perf(cpus): inline the reset function perf(cpus): inline the cpu_get_rev_var call perf(cpus): inline cpu_rev_var checks refactor(cpus): register DSU errata with the errata framework's wrappers refactor(cpus): convert checker functions to standard helpers refactor(cpus): convert the Cortex-A65 to use the errata framework fix(cpus): declare reset errata correctly
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 ...
|
| #
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 ...
|
| #
cc94e71b |
| 26-Sep-2024 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(cpus): undo errata mitigations
The workarounds introduced in the three patches starting at 888eafa00b99aa06b4ff688407336811a7ff439a assumed that any powerdown request will be (forced to be)
refactor(cpus): undo errata mitigations
The workarounds introduced in the three patches starting at 888eafa00b99aa06b4ff688407336811a7ff439a assumed that any powerdown request will be (forced to be) terminal. This assumption can no longer be the case for new CPUs so there is a need to revisit these older cores. Since we may wake up, we now need to respect the workaround's recommendation that the workaround needs to be reverted on wakeup. So do exactly that.
Introduce a new helper to toggle bits in assembly. This allows us to call the workaround twice, with the first call setting the workaround and second undoing it. This is also used for gelas' an travis' powerdown routines. This is so the same function can be called again
Also fix the condition in the cpu helper macro as it was subtly wrong
Change-Id: Iff9e5251dc9d8670d085d88c070f78991955e7c3 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| #
bb801857 |
| 21-Jan-2025 |
Boyan Karatotev <boyan.karatotev@arm.com> |
feat(cpus): add sysreg_bit_toggle
Introduce a new helper to toggle bits in assembly. This allows us to call the workaround twice, with the first call setting the workaround and second undoing it. Th
feat(cpus): add sysreg_bit_toggle
Introduce a new helper to toggle bits in assembly. This allows us to call the workaround twice, with the first call setting the workaround and second undoing it. This allows the (errata) workaround functions to be used to both apply and undo the mitigation.
This is applied to functions where the undo part will be required in follow-up patches.
Change-Id: I058bad58f5949b2d5fe058101410e33b6be1b8ba Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
show more ...
|
| #
1f2c58b1 |
| 31-Jan-2025 |
Bipin Ravi <bipin.ravi@arm.com> |
Merge changes from topic "ar/smccc_arch_wa_4" into integration
* changes: fix(security): apply SMCCC_ARCH_WORKAROUND_4 to affected cpus fix(security): add support in cpu_ops for CVE-2024-7881
Merge changes from topic "ar/smccc_arch_wa_4" into integration
* changes: fix(security): apply SMCCC_ARCH_WORKAROUND_4 to affected cpus fix(security): add support in cpu_ops for CVE-2024-7881 fix(security): add CVE-2024-7881 mitigation to Cortex-X3 fix(security): add CVE-2024-7881 mitigation to Neoverse-V3 fix(security): add CVE-2024-7881 mitigation to Neoverse-V2 fix(security): add CVE-2024-7881 mitigation to Cortex-X925 fix(security): add CVE-2024-7881 mitigation to Cortex-X4 fix(security): enable WORKAROUND_CVE_2024_7881 build option
show more ...
|
| #
4caef42a |
| 16-Sep-2024 |
Arvind Ram Prakash <arvind.ramprakash@arm.com> |
fix(security): add support in cpu_ops for CVE-2024-7881
This patch adds new cpu ops function extra4 and a new macro for CVE-2024-7881 [1]. This new macro declare_cpu_ops_wa_4 allows support for new
fix(security): add support in cpu_ops for CVE-2024-7881
This patch adds new cpu ops function extra4 and a new macro for CVE-2024-7881 [1]. This new macro declare_cpu_ops_wa_4 allows support for new CVE check function.
[1]: https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-7881
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I417389f040c6ead7f96f9b720d29061833f43d37
show more ...
|
| #
034b9197 |
| 21-Oct-2024 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge "chore(cpus): optimise runtime errata applications" into integration
|