]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[MIPS] lockdep: fix TRACE_IRQFLAGS_SUPPORT
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Tue, 26 Sep 2006 14:43:40 +0000 (23:43 +0900)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 1 Oct 2006 22:16:57 +0000 (23:16 +0100)
In handle_sys and its variants, we must reload some registers which
might be clobbered by trace_hardirqs_on().
Also we must make sure trace_hardirqs_on() called in kernel level (not
exception level).

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
include/asm-mips/irqflags.h

index e7178510220635c5da2be58e59c3b839a36a0bfa..61362e6fa9eccfbfb79b8abfde01d57b431f6e08 100644 (file)
 NESTED(handle_sys, PT_SIZE, sp)
        .set    noat
        SAVE_SOME
-#ifdef CONFIG_TRACE_IRQFLAGS
-       TRACE_IRQS_ON
-#ifdef CONFIG_64BIT
-       LONG_L  $8, PT_R8(sp)
-       LONG_L  $9, PT_R9(sp)
-#endif
-       LONG_L  $7, PT_R7(sp)
-       LONG_L  $6, PT_R6(sp)
-       LONG_L  $5, PT_R5(sp)
-       LONG_L  $4, PT_R4(sp)
-       LONG_L  $2, PT_R2(sp)
-#endif
+       TRACE_IRQS_ON_RELOAD
        STI
        .set    at
 
index 4c22d0b4825dc70bcdfb5d239dc458d60d6c185c..6c7b5ed0ea6e0ccec04ebfff052e0e9fd2fc780e 100644 (file)
@@ -34,7 +34,7 @@ NESTED(handle_sys64, PT_SIZE, sp)
         */
        .set    noat
        SAVE_SOME
-       TRACE_IRQS_ON
+       TRACE_IRQS_ON_RELOAD
        STI
        .set    at
 #endif
index f25c2a2f10387b10128bd92251cc9ee8df45559f..6d9f18727ac51e5baf3232f4624f733c8789732b 100644 (file)
@@ -33,7 +33,7 @@ NESTED(handle_sysn32, PT_SIZE, sp)
 #ifndef CONFIG_MIPS32_O32
        .set    noat
        SAVE_SOME
-       TRACE_IRQS_ON
+       TRACE_IRQS_ON_RELOAD
        STI
        .set    at
 #endif
index 288ee4ac4dbb8cce221c6b530b3da04bdae4eea1..2e6d0673163e1896cc2ac05d3299755f77f43aac 100644 (file)
@@ -28,7 +28,7 @@
 NESTED(handle_sys, PT_SIZE, sp)
        .set    noat
        SAVE_SOME
-       TRACE_IRQS_ON
+       TRACE_IRQS_ON_RELOAD
        STI
        .set    at
        ld      t1, PT_EPC(sp)          # skip syscall on return
index 43ca09a3a3d0ca2735b6f0b364c0190cee2569c4..46bf5de5ac720f1691b75bce5ea022eb7cf7d874 100644 (file)
@@ -213,12 +213,37 @@ static inline int raw_irqs_disabled_flags(unsigned long flags)
  * Do the CPU's IRQ-state tracing from assembly code.
  */
 #ifdef CONFIG_TRACE_IRQFLAGS
+/* Reload some registers clobbered by trace_hardirqs_on */
+#ifdef CONFIG_64BIT
+# define TRACE_IRQS_RELOAD_REGS                                                \
+       LONG_L  $11, PT_R11(sp);                                        \
+       LONG_L  $10, PT_R10(sp);                                        \
+       LONG_L  $9, PT_R9(sp);                                          \
+       LONG_L  $8, PT_R8(sp);                                          \
+       LONG_L  $7, PT_R7(sp);                                          \
+       LONG_L  $6, PT_R6(sp);                                          \
+       LONG_L  $5, PT_R5(sp);                                          \
+       LONG_L  $4, PT_R4(sp);                                          \
+       LONG_L  $2, PT_R2(sp)
+#else
+# define TRACE_IRQS_RELOAD_REGS                                                \
+       LONG_L  $7, PT_R7(sp);                                          \
+       LONG_L  $6, PT_R6(sp);                                          \
+       LONG_L  $5, PT_R5(sp);                                          \
+       LONG_L  $4, PT_R4(sp);                                          \
+       LONG_L  $2, PT_R2(sp)
+#endif
 # define TRACE_IRQS_ON                                                 \
+       CLI;    /* make sure trace_hardirqs_on() is called in kernel level */ \
        jal     trace_hardirqs_on
+# define TRACE_IRQS_ON_RELOAD                                          \
+       TRACE_IRQS_ON;                                                  \
+       TRACE_IRQS_RELOAD_REGS
 # define TRACE_IRQS_OFF                                                        \
        jal     trace_hardirqs_off
 #else
 # define TRACE_IRQS_ON
+# define TRACE_IRQS_ON_RELOAD
 # define TRACE_IRQS_OFF
 #endif