Commit e6e17ee8 authored by Dimitris Papastamos's avatar Dimitris Papastamos
Browse files

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: default avatarDimitris Papastamos <dimitris.papastamos@arm.com>
parent 2ff8fbf3
......@@ -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++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment