mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 05:54:08 +00:00
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>
This commit is contained in:
parent
2ff8fbf3b0
commit
e6e17ee8f1
1 changed files with 3 additions and 2 deletions
|
@ -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++)
|
||||
|
|
Loading…
Add table
Reference in a new issue