]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
powerpc/sstep: Fix emulate_step test if VSX not present
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>
Mon, 21 May 2018 04:21:08 +0000 (09:51 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 14:39:14 +0000 (00:39 +1000)
emulate_step() tests are failing if VSX is not supported or disabled.

  emulate_step_test: lxvd2x         : FAIL
  emulate_step_test: stxvd2x        : FAIL

If !CPU_FTR_VSX, emulate_step() failure is expected and testcase should
PASS with a valid justification. After patch:

  emulate_step_test: lxvd2x         : PASS (!CPU_FTR_VSX)
  emulate_step_test: stxvd2x        : PASS (!CPU_FTR_VSX)

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/lib/test_emulate_step.c

index 2534c14475546a57b12a64ddf11fb2519c87de82..6c47daa616149f745bf96702157ed9a38405437a 100644 (file)
@@ -387,10 +387,14 @@ static void __init test_lxvd2x_stxvd2x(void)
        /* lxvd2x vsr39, r3, r4 */
        stepped = emulate_step(&regs, TEST_LXVD2X(39, 3, 4));
 
-       if (stepped == 1)
+       if (stepped == 1 && cpu_has_feature(CPU_FTR_VSX)) {
                show_result("lxvd2x", "PASS");
-       else
-               show_result("lxvd2x", "FAIL");
+       } else {
+               if (!cpu_has_feature(CPU_FTR_VSX))
+                       show_result("lxvd2x", "PASS (!CPU_FTR_VSX)");
+               else
+                       show_result("lxvd2x", "FAIL");
+       }
 
 
        /*** stxvd2x ***/
@@ -404,10 +408,15 @@ static void __init test_lxvd2x_stxvd2x(void)
        stepped = emulate_step(&regs, TEST_STXVD2X(39, 3, 4));
 
        if (stepped == 1 && cached_b[0] == c.b[0] && cached_b[1] == c.b[1] &&
-           cached_b[2] == c.b[2] && cached_b[3] == c.b[3])
+           cached_b[2] == c.b[2] && cached_b[3] == c.b[3] &&
+           cpu_has_feature(CPU_FTR_VSX)) {
                show_result("stxvd2x", "PASS");
-       else
-               show_result("stxvd2x", "FAIL");
+       } else {
+               if (!cpu_has_feature(CPU_FTR_VSX))
+                       show_result("stxvd2x", "PASS (!CPU_FTR_VSX)");
+               else
+                       show_result("stxvd2x", "FAIL");
+       }
 }
 #else
 static void __init test_lxvd2x_stxvd2x(void)