diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-09-26 10:43:40 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-10-01 18:16:57 -0400 |
commit | eae6c0da9df81300895949897c0451423340ac40 (patch) | |
tree | a5e2d512d72e316a8aa79ec20286d1f2a8a98db3 | |
parent | d834c16516d1ebec4766fc58c059bf01311e6045 (diff) |
[MIPS] lockdep: fix TRACE_IRQFLAGS_SUPPORT
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>
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 13 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-64.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 2 | ||||
-rw-r--r-- | include/asm-mips/irqflags.h | 25 |
5 files changed, 29 insertions, 15 deletions
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index e71785102206..61362e6fa9ec 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -28,18 +28,7 @@ | |||
28 | NESTED(handle_sys, PT_SIZE, sp) | 28 | NESTED(handle_sys, PT_SIZE, sp) |
29 | .set noat | 29 | .set noat |
30 | SAVE_SOME | 30 | SAVE_SOME |
31 | #ifdef CONFIG_TRACE_IRQFLAGS | 31 | TRACE_IRQS_ON_RELOAD |
32 | TRACE_IRQS_ON | ||
33 | #ifdef CONFIG_64BIT | ||
34 | LONG_L $8, PT_R8(sp) | ||
35 | LONG_L $9, PT_R9(sp) | ||
36 | #endif | ||
37 | LONG_L $7, PT_R7(sp) | ||
38 | LONG_L $6, PT_R6(sp) | ||
39 | LONG_L $5, PT_R5(sp) | ||
40 | LONG_L $4, PT_R4(sp) | ||
41 | LONG_L $2, PT_R2(sp) | ||
42 | #endif | ||
43 | STI | 32 | STI |
44 | .set at | 33 | .set at |
45 | 34 | ||
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 4c22d0b4825d..6c7b5ed0ea6e 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -34,7 +34,7 @@ NESTED(handle_sys64, PT_SIZE, sp) | |||
34 | */ | 34 | */ |
35 | .set noat | 35 | .set noat |
36 | SAVE_SOME | 36 | SAVE_SOME |
37 | TRACE_IRQS_ON | 37 | TRACE_IRQS_ON_RELOAD |
38 | STI | 38 | STI |
39 | .set at | 39 | .set at |
40 | #endif | 40 | #endif |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index f25c2a2f1038..6d9f18727ac5 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -33,7 +33,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) | |||
33 | #ifndef CONFIG_MIPS32_O32 | 33 | #ifndef CONFIG_MIPS32_O32 |
34 | .set noat | 34 | .set noat |
35 | SAVE_SOME | 35 | SAVE_SOME |
36 | TRACE_IRQS_ON | 36 | TRACE_IRQS_ON_RELOAD |
37 | STI | 37 | STI |
38 | .set at | 38 | .set at |
39 | #endif | 39 | #endif |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 288ee4ac4dbb..2e6d0673163e 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -28,7 +28,7 @@ | |||
28 | NESTED(handle_sys, PT_SIZE, sp) | 28 | NESTED(handle_sys, PT_SIZE, sp) |
29 | .set noat | 29 | .set noat |
30 | SAVE_SOME | 30 | SAVE_SOME |
31 | TRACE_IRQS_ON | 31 | TRACE_IRQS_ON_RELOAD |
32 | STI | 32 | STI |
33 | .set at | 33 | .set at |
34 | ld t1, PT_EPC(sp) # skip syscall on return | 34 | ld t1, PT_EPC(sp) # skip syscall on return |
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h index 43ca09a3a3d0..46bf5de5ac72 100644 --- a/include/asm-mips/irqflags.h +++ b/include/asm-mips/irqflags.h | |||
@@ -213,12 +213,37 @@ static inline int raw_irqs_disabled_flags(unsigned long flags) | |||
213 | * Do the CPU's IRQ-state tracing from assembly code. | 213 | * Do the CPU's IRQ-state tracing from assembly code. |
214 | */ | 214 | */ |
215 | #ifdef CONFIG_TRACE_IRQFLAGS | 215 | #ifdef CONFIG_TRACE_IRQFLAGS |
216 | /* Reload some registers clobbered by trace_hardirqs_on */ | ||
217 | #ifdef CONFIG_64BIT | ||
218 | # define TRACE_IRQS_RELOAD_REGS \ | ||
219 | LONG_L $11, PT_R11(sp); \ | ||
220 | LONG_L $10, PT_R10(sp); \ | ||
221 | LONG_L $9, PT_R9(sp); \ | ||
222 | LONG_L $8, PT_R8(sp); \ | ||
223 | LONG_L $7, PT_R7(sp); \ | ||
224 | LONG_L $6, PT_R6(sp); \ | ||
225 | LONG_L $5, PT_R5(sp); \ | ||
226 | LONG_L $4, PT_R4(sp); \ | ||
227 | LONG_L $2, PT_R2(sp) | ||
228 | #else | ||
229 | # define TRACE_IRQS_RELOAD_REGS \ | ||
230 | LONG_L $7, PT_R7(sp); \ | ||
231 | LONG_L $6, PT_R6(sp); \ | ||
232 | LONG_L $5, PT_R5(sp); \ | ||
233 | LONG_L $4, PT_R4(sp); \ | ||
234 | LONG_L $2, PT_R2(sp) | ||
235 | #endif | ||
216 | # define TRACE_IRQS_ON \ | 236 | # define TRACE_IRQS_ON \ |
237 | CLI; /* make sure trace_hardirqs_on() is called in kernel level */ \ | ||
217 | jal trace_hardirqs_on | 238 | jal trace_hardirqs_on |
239 | # define TRACE_IRQS_ON_RELOAD \ | ||
240 | TRACE_IRQS_ON; \ | ||
241 | TRACE_IRQS_RELOAD_REGS | ||
218 | # define TRACE_IRQS_OFF \ | 242 | # define TRACE_IRQS_OFF \ |
219 | jal trace_hardirqs_off | 243 | jal trace_hardirqs_off |
220 | #else | 244 | #else |
221 | # define TRACE_IRQS_ON | 245 | # define TRACE_IRQS_ON |
246 | # define TRACE_IRQS_ON_RELOAD | ||
222 | # define TRACE_IRQS_OFF | 247 | # define TRACE_IRQS_OFF |
223 | #endif | 248 | #endif |
224 | 249 | ||