feat: skip asymmetric tests when features not present
This patch skips asymmetric tests, when features are not present
and will split them into separate tests.
The problem with the previous test structure was that you can't
distinguish between a trap to EL2 and an undef injection. This meant
that on some platforms, the tests would pass even without the
asymmetric support patches. In these cases, it would be better if the
test was skipped, since there's no situation where it fails.
For example, if FEAT_SPE wasn't present on any cores, and the
asymmetric support patches weren't applied, then the test would pass.
This is because the register accesses would trap to EL2.
This patch skips the test on every core that doesn't have the feature
implemented. It also splits the test into separate test functions.
This allows us to display a separate test result for each asymmetric
test. It also allows us to skip the whole test if the feature isn't
present on any cores, since in these cases the test would always pass.
The structure of the test is similar to
tftf/tests/runtime_services/standard_service/psci/api_tests/cpu_suspend/test_suspend.c.
The run_asymmetric_test function takes a function as an argument, and
runs it on all CPUs.
The whole test should only be skipped if the test was skipped on all
CPUs. The test on each CPU can't return TEST_RESULT_SKIPPED, because
the whole test is skipped if any of the CPUs return
TEST_RESULT_SKIPPED. Instead, to skip a test, the test returns
TEST_RESULT_SUCCESS, then sets a flag in the test_skipped array. This
array is checked at the end by the run_asymmetric_test function.
Change-Id: I802431714de3eb8b059e8fc56f7e19fc94e3e8fb
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
4 files changed