Remove unexecuted code for AMU group 1 counters
This patch removes from the AMU tests the part that iterates over group
1 counters. The reasons for this are the following:
1) Currently the AMU tests are executed only in FVP but FVP doesn't
have/expose group 1 counters.
2) Even if some platform implements group 1 counters in the future, we
don't know what they will be counting. As such we cannot know what the
valid values for those counters will be. Hence, we can't establish a
specific test at this moment to validate the group 1 counter values.
3) Even now that the loop exists in the code, the macro defining the
group 1 counters is defined as zero. Which means that the loop is
already not executed, despite being there (dead code).
However, the architecture defines how group 1 counters should be
implemented. For this reason, the assembly helper functions that access
the group1 counters are left intact. This will allow us to easily extend
the AMU tests again in the future to include group 1 counters.
Change-Id: I5a6f119c7e817de9dc5e510c3fadd008820bd564
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
diff --git a/tftf/tests/extensions/amu/test_amu.c b/tftf/tests/extensions/amu/test_amu.c
index 2e2ea6f..a272aaf 100644
--- a/tftf/tests/extensions/amu/test_amu.c
+++ b/tftf/tests/extensions/amu/test_amu.c
@@ -104,8 +104,7 @@
return TEST_RESULT_SKIPPED;
/* If counters are not enabled, then skip the test */
- if (read_amcntenset0_el0() != AMU_GROUP0_COUNTERS_MASK ||
- read_amcntenset1_el0() != AMU_GROUP1_COUNTERS_MASK)
+ if (read_amcntenset0_el0() != AMU_GROUP0_COUNTERS_MASK)
return TEST_RESULT_SKIPPED;
for (i = 0; i < AMU_GROUP0_NR_COUNTERS; i++) {
@@ -118,16 +117,6 @@
}
}
- for (i = 0; i < AMU_GROUP1_NR_COUNTERS; i++) {
- uint64_t v;
-
- v = amu_group1_cnt_read(i);
- if (v == 0) {
- tftf_testcase_printf("Group1 counter cannot be 0\n");
- return TEST_RESULT_FAIL;
- }
- }
-
return TEST_RESULT_SUCCESS;
}
@@ -138,24 +127,19 @@
test_result_t test_amu_suspend_resume(void)
{
uint64_t group0_ctrs[AMU_GROUP0_MAX_NR_COUNTERS];
- uint64_t group1_ctrs[AMU_GROUP1_MAX_NR_COUNTERS];
int i;
if (!amu_supported())
return TEST_RESULT_SKIPPED;
/* If counters are not enabled, then skip the test */
- if (read_amcntenset0_el0() != AMU_GROUP0_COUNTERS_MASK ||
- read_amcntenset1_el0() != AMU_GROUP1_COUNTERS_MASK)
+ if (read_amcntenset0_el0() != AMU_GROUP0_COUNTERS_MASK)
return TEST_RESULT_SKIPPED;
/* Save counters values before suspend */
for (i = 0; i < AMU_GROUP0_NR_COUNTERS; i++)
group0_ctrs[i] = amu_group0_cnt_read(i);
- for (i = 0; i < AMU_GROUP1_NR_COUNTERS; i++)
- group1_ctrs[i] = amu_group1_cnt_read(i);
-
/* Suspend/resume current core */
suspend_and_resume_this_cpu();
@@ -175,17 +159,5 @@
}
}
- for (i = 0; i < AMU_GROUP1_NR_COUNTERS; i++) {
- uint64_t v;
-
- v = amu_group1_cnt_read(i);
- if (v < group1_ctrs[i]) {
- tftf_testcase_printf("Invalid counter value: before: %llx, after: %llx\n",
- (unsigned long long)group1_ctrs[i],
- (unsigned long long)v);
- return TEST_RESULT_FAIL;
- }
- }
-
return TEST_RESULT_SUCCESS;
}