summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-02-20 11:16:44 +0000
committerDimitris Papastamos <dimitris.papastamos@arm.com>2018-02-27 12:05:59 +0000
commite6e17ee8f17cc0e34bf681cc36e0954b6cf2e319 (patch)
treeb39c092da9f4ef25795361f3a8f5cc8a5cf5ad46 /lib
parent2ff8fbf3b0d1403afab9b5316fd7ea40859c889c (diff)
Assert that group0/group1 counter config is what we expect
Before suspend the AMU counters should be enabled and after resume they should be disabled. Assert that to be consistent with the AArch64 implementation of `amu_context_{save,restore}()`. Change-Id: Ia46f77e4062b93afb93721a2890a9b9d2a7f300e Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/extensions/amu/aarch32/amu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/extensions/amu/aarch32/amu.c b/lib/extensions/amu/aarch32/amu.c
index 68cc4b34..6898f756 100644
--- a/lib/extensions/amu/aarch32/amu.c
+++ b/lib/extensions/amu/aarch32/amu.c
@@ -109,7 +109,8 @@ static void *amu_context_save(const void *arg)
ctx = &amu_ctxs[plat_my_core_pos()];
/* Assert that group 0 counter configuration is what we expect */
- assert(read_amcntenset0() == AMU_GROUP0_COUNTERS_MASK);
+ assert(read_amcntenset0() == AMU_GROUP0_COUNTERS_MASK &&
+ read_amcntenset1() == AMU_GROUP1_COUNTERS_MASK);
/*
* Disable group 0 counters to avoid other observers like SCP sampling
@@ -141,7 +142,7 @@ static void *amu_context_restore(const void *arg)
ctx = &amu_ctxs[plat_my_core_pos()];
/* Counters were disabled in `amu_context_save()` */
- assert(read_amcntenset0() == 0);
+ assert(read_amcntenset0() == 0 && read_amcntenset1() == 0);
/* Restore group 0 counters */
for (i = 0; i < AMU_GROUP0_NR_COUNTERS; i++)