tests/trace: Test trace interrupt vs. FP unavailable interrupt
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 25 Sep 2020 08:14:18 +0000 (18:14 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 5 Oct 2020 08:12:17 +0000 (19:12 +1100)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
tests/test_trace.bin
tests/test_trace.console_out
tests/trace/head.S
tests/trace/trace.c

index b9a612d6b6df4450a701117064157bb6fd10b545..61fa48b3e6e4a2553a30e0e14727533689f4fc7b 100755 (executable)
Binary files a/tests/test_trace.bin and b/tests/test_trace.bin differ
index 340756c8216bc1bab3c55cda0dcfff26acc121a1..25e791c7845c3022d90eeeb6f4e465b8c29742f6 100644 (file)
@@ -5,3 +5,4 @@ test 04:PASS
 test 05:PASS\r
 test 06:PASS\r
 test 07:PASS\r
+test 08:PASS\r
index d23aeb791bf9df39b835738ba2af3c4c24522214..778baaaf62262607744380cce11514b4a5dade88 100644 (file)
@@ -214,3 +214,8 @@ test7:
        bne     1f
        li      %r3,-1
 1:     blr
+
+       .global test8
+test8:
+       lfd     %f0,0(%r3)
+       blr
index 5f7ae9f1069bb94c0ca83382f645d6df3e2b9321..a859f4e4b95e4ceef5f4961a9f94ca7f133c39c3 100644 (file)
@@ -8,6 +8,7 @@ extern unsigned long callit(unsigned long arg1, unsigned long arg2,
                            unsigned long (*fn)(unsigned long, unsigned long),
                            unsigned long msr, unsigned long *regs);
 
+#define MSR_FP 0x2000
 #define MSR_SE 0x400
 #define MSR_BE 0x200
 
@@ -188,6 +189,22 @@ int trace_test_7(void)
        return 0;
 }
 
+extern unsigned long test8(unsigned long, unsigned long);
+
+int trace_test_8(void)
+{
+       unsigned long ret;
+       unsigned long regs[2];
+
+       ret = callit(0, 0, test8, (mfmsr() & ~MSR_FP) | MSR_SE, regs);
+       if (ret != 0x800)
+               return ret + 1;
+       ret = callit(0, 0, test8, mfmsr() | MSR_FP | MSR_SE, regs);
+       if (ret != 0xd00)
+               return ret + 2;
+       return 0;
+}
+
 int fail = 0;
 
 void do_test(int num, int (*test)(void))
@@ -217,6 +234,7 @@ int main(void)
        do_test(5, trace_test_5);
        do_test(6, trace_test_6);
        do_test(7, trace_test_7);
+       do_test(8, trace_test_8);
 
        return fail;
 }