build(changelog): add new scope for Performance Monitor Extensions

This patch adds a news scope for FEAT_PMUV3, alongside
updating the existing comments related to the saving of
PMCR_EL0 register routine for better understanding.

Change-Id: Ib150244ce94cfcbbe5d12fdae56327c3d72bda0b
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
This commit is contained in:
Jayanth Dodderi Chidanand 2022-09-19 23:32:08 +01:00
parent d8d0ea9a7f
commit d64bfef5a1
2 changed files with 24 additions and 7 deletions

View File

@ -128,6 +128,9 @@ subsections:
- title: Trapping support for RNDR/RNDRRS (FEAT_RNG_TRAP) - title: Trapping support for RNDR/RNDRRS (FEAT_RNG_TRAP)
scope: rng-trap scope: rng-trap
- title: Performance Monitors Extension (FEAT_PMUv3)
scope: pmu
- title: Platforms - title: Platforms
subsections: subsections:

View File

@ -806,9 +806,9 @@ endfunc fpregs_context_restore
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
* The following macro is used to save and restore all the general * The following macro is used to save and restore all the general
* purpose and ARMv8.3-PAuth (if enabled) registers. * purpose and ARMv8.3-PAuth (if enabled) registers.
* It also checks if Secure Cycle Counter is not disabled in MDCR_EL3 * It also checks if the Secure Cycle Counter (PMCCNTR_EL0)
* when ARMv8.5-PMU is implemented, and if called from Non-secure * is disabled in EL3/Secure (ARMv8.5-PMU), wherein PMCCNTR_EL0
* state saves PMCR_EL0 and disables Cycle Counter. * needs not to be saved/restored during world switch.
* *
* Ideally we would only save and restore the callee saved registers * Ideally we would only save and restore the callee saved registers
* when a world switch occurs but that type of implementation is more * when a world switch occurs but that type of implementation is more
@ -837,9 +837,17 @@ endfunc fpregs_context_restore
str x18, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_SP_EL0] str x18, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_SP_EL0]
/* ---------------------------------------------------------- /* ----------------------------------------------------------
* Check if earlier initialization MDCR_EL3.SCCD/MCCD to 1 * Check if earlier initialization of MDCR_EL3.SCCD/MCCD to 1
* failed, meaning that FEAT_PMUv3p5/7 is not implemented and * has failed.
* PMCR_EL0 should be saved in non-secure context. *
* MDCR_EL3:
* MCCD bit set, Prohibits the Cycle Counter PMCCNTR_EL0 from
* counting at EL3.
* SCCD bit set, Secure Cycle Counter Disable. Prohibits PMCCNTR_EL0
* from counting in Secure state.
* If these bits are not set, meaning that FEAT_PMUv3p5/7 is
* not implemented and PMCR_EL0 should be saved in non-secure
* context.
* ---------------------------------------------------------- * ----------------------------------------------------------
*/ */
mov_imm x10, (MDCR_SCCD_BIT | MDCR_MCCD_BIT) mov_imm x10, (MDCR_SCCD_BIT | MDCR_MCCD_BIT)
@ -847,7 +855,13 @@ endfunc fpregs_context_restore
tst x9, x10 tst x9, x10
bne 1f bne 1f
/* Secure Cycle Counter is not disabled */ /* ----------------------------------------------------------
* If control reaches here, it ensures the Secure Cycle
* Counter (PMCCNTR_EL0) is not prohibited from counting at
* EL3 and in secure states.
* Henceforth, PMCR_EL0 to be saved before world switch.
* ----------------------------------------------------------
*/
mrs x9, pmcr_el0 mrs x9, pmcr_el0
/* Check caller's security state */ /* Check caller's security state */