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/runtime/core/init.c b/runtime/core/init.c
index c067d12..81bdfeb 100644
--- a/runtime/core/init.c
+++ b/runtime/core/init.c
@@ -3,7 +3,7 @@
* SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
*/
-#include <arch_helpers.h>
+#include <arch_features.h>
#include <attestation.h>
#include <buffer.h>
#include <debug.h>
@@ -28,7 +28,10 @@
SPE(write_pmscr_el2(PMSCR_EL2_INIT));
write_cnthctl_el2(CNTHCTL_EL2_INIT);
- write_mdcr_el2(MDCR_EL2_INIT);
+ write_vpidr_el2(read_midr_el1());
+ write_mdcr_el2(MDCR_EL2_INIT |
+ INPLACE(MDCR_EL2_HPMN,
+ EXTRACT(PMCR_EL0_N, read_pmcr_el0())));
}
void rmm_warmboot_main(void)