feat(pmu): add PMU support for Realms
This patch adds support for using PMU in Realms.
It adds 'bool pmu_enabled' and 'unsigned int pmu_num_cnts'
variables in 'struct rd' and 'struct rec.realm_info'.
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I13aad600a0215ba66d25be12ede5f4b86e6b018a
diff --git a/plat/host/common/src/host_utils.c b/plat/host/common/src/host_utils.c
index 263f518..910bb6a 100644
--- a/plat/host/common/src/host_utils.c
+++ b/plat/host/common/src/host_utils.c
@@ -137,6 +137,13 @@
int ret;
/*
+ * Initialize ID_AA64DFR0_EL1 with PMUVer field to PMUv3p7.
+ * (ID_AA64DFR0_EL1.PMUVer, bits [11:8] set to 7)
+ */
+ ret = host_util_set_default_sysreg_cb("id_aa64dfr0_el1",
+ INPLACE(ID_AA64DFR0_EL1_PMUVer, 7UL));
+
+ /*
* Initialize ID_AA64MMFR0_EL1 with a physical address
* range of 48 bits (PARange bits set to 0b0101)
*/
@@ -167,6 +174,13 @@
ret = host_util_set_default_sysreg_cb("elr_el2", 0UL);
/*
+ * Set number of event counters implemented to 31.
+ * (PMCR_EL0.N, bits [15:11] set to 31)
+ */
+ ret = host_util_set_default_sysreg_cb("pmcr_el0",
+ INPLACE(PMCR_EL0_N, 31UL));
+
+ /*
* Only check the return value of the last callback setup, to detect
* if we are out of callback slots.
*/