aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
authorJordan Niethe2020-05-25 12:59:22 +1000
committerMichael Ellerman2020-07-23 17:25:18 +1000
commit301ebf7d69f6709575d137a41a0291f69f343aed (patch)
tree5f92b85b3ae8079ab891d10f419dc54a1dc42a5b /arch/powerpc/lib
parent1c89cf7fbed36f078b20fd47d308b4fc6dbff5f6 (diff)
powerpc/sstep: Let compute tests specify a required cpu feature
An a array of struct compute_test's are used to declare tests for compute instructions. Add a cpu_feature field to struct compute_test as an optional way to specify a cpu feature that must be present. If not present then skip the test. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200525025923.19843-4-jniethe5@gmail.com
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r--arch/powerpc/lib/test_emulate_step.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/lib/test_emulate_step.c b/arch/powerpc/lib/test_emulate_step.c
index 857b95ef5713..f8cd3ca356c6 100644
--- a/arch/powerpc/lib/test_emulate_step.c
+++ b/arch/powerpc/lib/test_emulate_step.c
@@ -625,6 +625,7 @@ static void __init run_tests_load_store(void)
struct compute_test {
char *mnemonic;
+ unsigned long cpu_feature;
struct {
char *descr;
unsigned long flags;
@@ -1068,6 +1069,11 @@ static void __init run_tests_compute(void)
for (i = 0; i < ARRAY_SIZE(compute_tests); i++) {
test = &compute_tests[i];
+ if (test->cpu_feature && !early_cpu_has_feature(test->cpu_feature)) {
+ show_result(test->mnemonic, "SKIP (!CPU_FTR)");
+ continue;
+ }
+
for (j = 0; j < MAX_SUBTESTS && test->subtests[j].descr; j++) {
instr = test->subtests[j].instr;
flags = test->subtests[j].flags;