tests/fpu: Test FPU unavailable interrupt following a load
authorPaul Mackerras <paulus@ozlabs.org>
Wed, 26 May 2021 07:44:19 +0000 (17:44 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 10 Aug 2021 10:13:26 +0000 (20:13 +1000)
This adds a load before a floating-point load which should generate a
floating-point unavailable interrupt, to test for the bug where
unavailability interrupts can get dropped while loadstore1 is
executing instructions.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
tests/fpu/fpu.c
tests/test_fpu.bin

index 52f21d04685b4ab6eac52cc36d60a049efa0504a..500e92df0ea6d4d4b8c196862a1e9733d4094dd4 100644 (file)
@@ -106,9 +106,11 @@ int fooiw;
 
 int do_fp_op(long arg)
 {
+       unsigned long tmp;
+
        switch (arg) {
        case 0:
-               asm("lfd 31,0(%0)" : : "b" (&foo));
+               asm("ld %0,0(%1); lfd 31,0(%1)" : "=&r" (tmp) : "b" (&foo));
                break;
        case 1:
                asm("stfd 31,0(%0)" : : "b" (&foow) : "memory");
index 50831cb20db40951fb7b0e508677cfddb62e46c6..dee8fbd85688699b9adc077133670fe8eea299ae 100755 (executable)
Binary files a/tests/test_fpu.bin and b/tests/test_fpu.bin differ