| 4085a02c | 27-Mar-2023 |
Boyan Karatotev <boyan.karatotev@arm.com> |
refactor(amu): separate the EL2 and EL3 enablement code
Combining the EL2 and EL3 enablement code necessitates that it must be called at el3_exit, which is the only place with enough context to make
refactor(amu): separate the EL2 and EL3 enablement code
Combining the EL2 and EL3 enablement code necessitates that it must be called at el3_exit, which is the only place with enough context to make the decision of what needs to be set. Decouple them to allow them to be called from elsewhere. Also take some time to clarify and simplify AMU code.
The sanity check in the context_restore() is now wrong, as the cpu may turn off on suspend, thus resetting the value of the counter enables. Remove it.
Finally, this completes the migration to cm_manage_extensions_el3() and manage_extensions_nonsecure() so manage_extensions_nonsecure_mixed() is being removed.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Change-Id: I66399132364c32be66017506bb54cbadd8485577
show more ...
|
| 2b0bc4e0 | 07-Mar-2023 |
Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> |
feat(cpufeat): enable FEAT_SVE for FEAT_STATE_CHECKED
Add support for runtime detection (ENABLE_SVE_FOR_NS=2), by splitting sve_supported() into an ID register reading function and a second function
feat(cpufeat): enable FEAT_SVE for FEAT_STATE_CHECKED
Add support for runtime detection (ENABLE_SVE_FOR_NS=2), by splitting sve_supported() into an ID register reading function and a second function to report the support status. That function considers both build time settings and runtime information (if needed), and is used before we do SVE specific setup.
Change the FVP platform default to the now supported dynamic option (=2), so the right decision can be made by the code at runtime.
Change-Id: I1caaba2216e8e2a651452254944a003607503216 Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
show more ...
|
| 603a0c6f | 17-Nov-2022 |
Andre Przywara <andre.przywara@arm.com> |
refactor(cpufeat): enable SYS_REG_TRACE for FEAT_STATE_CHECKED
At the moment we only support access to the trace unit by system registers (SYS_REG_TRACE) to be either unconditionally compiled in, or
refactor(cpufeat): enable SYS_REG_TRACE for FEAT_STATE_CHECKED
At the moment we only support access to the trace unit by system registers (SYS_REG_TRACE) to be either unconditionally compiled in, or to be not supported at all.
Add support for runtime detection (ENABLE_SYS_REG_TRACE_FOR_NS=2), by adding is_feat_sys_reg_trace_supported(). That function considers both build time settings and runtime information (if needed), and is used before we access SYS_REG_TRACE related registers.
The FVP platform decided to compile in support unconditionally (=1), even though this is an optional feature, so it is not available with the FVP model's default command line. Change that to the now supported dynamic option (=2), so the right decision can be made by the code at runtime.
Change-Id: I450a574a4f6bd9fc269887037049c94c906f54b2 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| d7f3ed36 | 22-Mar-2023 |
Andre Przywara <andre.przywara@arm.com> |
fix(cpufeat): make stub enable functions "static inline"
For builds where we don't have a certain feature enabled, we provide empty stub xxx_enable() functions in a header file. This way we avoid #i
fix(cpufeat): make stub enable functions "static inline"
For builds where we don't have a certain feature enabled, we provide empty stub xxx_enable() functions in a header file. This way we avoid #ifdef's in the code, and can call the enable function unconditionally. When compiling with -O1 or higher, the compiler will even optimise out the whole call, so the symbol will never make it into any object file. When compiling with optimisations turned off, the function stub will survive, and could make it into multiple object files, which would lead to a multiple definitons error.
Avoid this by defining those stub functions as "static inline". The "static" will avoid the multiple definitions problems, the "inline" will avoid a potential compiler warning about unused functions. This patterns is used extensively in the Linux kernel.
Change-Id: Iad07bb946aab372587c83f2423b4983bf3817990 Reported-by: Chris Kay <chris.kay@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| 9448f2b8 | 17-Nov-2022 |
Andre Przywara <andre.przywara@arm.com> |
refactor(mpam): enable FEAT_MPAM for FEAT_STATE_CHECKED
At the moment we only support FEAT_MPAM to be either unconditionally compiled in, or to be not supported at all.
Add support for runtime dete
refactor(mpam): enable FEAT_MPAM for FEAT_STATE_CHECKED
At the moment we only support FEAT_MPAM to be either unconditionally compiled in, or to be not supported at all.
Add support for runtime detection (ENABLE_MPAM_FOR_LOWER_ELS=2), by splitting get_mpam_version() into an ID register reading function and a second function to report the support status. That function considers both build time settings and runtime information (if needed), and is used before we access MPAM related registers. Also move the context saving code from assembly to C, and use the new is_feat_mpam_supported() function to guard its execution.
ENABLE_MPAM_FOR_LOWER_ELS defaults to 0, so add a stub enable function to cover builds with compiler optimisations turned off. The unused mpam_enable() function call will normally be optimised away (because it would never be called), but with -O0 the compiler will leave the symbol in the object file.
Change-Id: I531d87cb855a7c43471f861f625b5a6d4bc61313 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| 742ca230 | 19-Aug-2021 |
Chris Kay <chris.kay@arm.com> |
feat(amu): enable per-core AMU auxiliary counters
This change makes AMU auxiliary counters configurable on a per-core basis, controlled by `ENABLE_AMU_AUXILIARY_COUNTERS`.
Auxiliary counters can be
feat(amu): enable per-core AMU auxiliary counters
This change makes AMU auxiliary counters configurable on a per-core basis, controlled by `ENABLE_AMU_AUXILIARY_COUNTERS`.
Auxiliary counters can be described via the `HW_CONFIG` device tree if the `ENABLE_AMU_FCONF` build option is enabled, or the platform must otherwise implement the `plat_amu_topology` function.
A new phandle property for `cpu` nodes (`amu`) has been introduced to the `HW_CONFIG` specification to allow CPUs to describe the view of their own AMU:
``` cpu0: cpu@0 { ...
amu = <&cpu0_amu>; }; ```
Multiple cores may share an `amu` handle if they implement the same set of auxiliary counters.
AMU counters are described for one or more AMUs through the use of a new `amus` node:
``` amus { cpu0_amu: amu-0 { #address-cells = <1>; #size-cells = <0>;
counter@0 { reg = <0>;
enable-at-el3; };
counter@n { reg = <n>;
... }; }; }; ```
This structure describes the **auxiliary** (group 1) AMU counters. Architected counters have architecturally-defined behaviour, and as such do not require DTB entries.
These `counter` nodes support two properties:
- The `reg` property represents the counter register index. - The presence of the `enable-at-el3` property determines whether the firmware should enable the counter prior to exiting EL3.
Change-Id: Ie43aee010518c5725a3b338a4899b0857caf4c28 Signed-off-by: Chris Kay <chris.kay@arm.com>
show more ...
|
| 81e2ff1f | 25-May-2021 |
Chris Kay <chris.kay@arm.com> |
refactor(amu): detect architected counters at runtime
This change removes the `AMU_GROUP0_COUNTERS_MASK` and `AMU_GROUP0_MAX_COUNTERS` preprocessor definitions, instead retrieving the number of grou
refactor(amu): detect architected counters at runtime
This change removes the `AMU_GROUP0_COUNTERS_MASK` and `AMU_GROUP0_MAX_COUNTERS` preprocessor definitions, instead retrieving the number of group 0 counters dynamically through `AMCGCR_EL0.CG0NC`.
Change-Id: I70e39c30fbd5df89b214276fac79cc8758a89f72 Signed-off-by: Chris Kay <chris.kay@arm.com>
show more ...
|
| 1fd685a7 | 25-May-2021 |
Chris Kay <chris.kay@arm.com> |
refactor(amu): conditionally compile auxiliary counter support
This change reduces preprocessor dependencies on the `AMU_GROUP1_NR_COUNTERS` and `AMU_GROUP1_COUNTERS_MASK` definitions, as these valu
refactor(amu): conditionally compile auxiliary counter support
This change reduces preprocessor dependencies on the `AMU_GROUP1_NR_COUNTERS` and `AMU_GROUP1_COUNTERS_MASK` definitions, as these values will eventually be discovered dynamically.
In their stead, we introduce the `ENABLE_AMU_AUXILIARY_COUNTERS` build option, which will enable support for dynamically detecting and enabling auxiliary AMU counters.
This substantially reduces the amount of memory used by platforms that know ahead of time that they do not have any auxiliary AMU counters.
Change-Id: I3d998aff44ed5489af4857e337e97634d06e3ea1 Signed-off-by: Chris Kay <chris.kay@arm.com>
show more ...
|
| b4b726ea | 24-May-2021 |
Chris Kay <chris.kay@arm.com> |
refactor(amu)!: privatize unused AMU APIs
This change reduces the exposed surface area of the AMU API in order to simplify the refactoring work in following patches. The functions and definitions pr
refactor(amu)!: privatize unused AMU APIs
This change reduces the exposed surface area of the AMU API in order to simplify the refactoring work in following patches. The functions and definitions privatized by this change are not used by other parts of the code-base today.
BREAKING CHANGE: The public AMU API has been reduced to enablement only to facilitate refactoring work. These APIs were not previously used.
Change-Id: Ibf6174fb5b3949de3c4ba6847cce47d82a6bd08c Signed-off-by: Chris Kay <chris.kay@arm.com>
show more ...
|