]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sparc64: Reschedule KGDB capture to a software interrupt.
authorDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2009 02:00:54 +0000 (19:00 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Jun 2009 03:01:15 +0000 (20:01 -0700)
[ Upstream commit 42cc77c861e8e850e86252bb5b1e12e006261973 ]

Otherwise it might interrupt switch_to() midstream and use
half-cooked register window state.

Reported-by: Chris Torek <chris.torek@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc/include/asm/pil.h
arch/sparc64/kernel/kgdb.c
arch/sparc64/kernel/ttable.S
arch/sparc64/mm/ultra.S

index 71819bb943fc7e863f0a82cd8e4ff11f2b324c74..6ea90d7eec27c6bbcc764806452126558b823a48 100644 (file)
@@ -18,5 +18,6 @@
 #define PIL_SMP_CTX_NEW_VERSION        4
 #define PIL_DEVICE_IRQ         5
 #define PIL_SMP_CALL_FUNC_SNGL 6
+#define PIL_KGDB_CAPTURE       8
 
 #endif /* !(_SPARC64_PIL_H) */
index fefbe6dc51bed68e3f4df4b6e74b3b01ae5eae69..f5a0fd490b59cb27c90381b92edac2ae2809bb71 100644 (file)
@@ -108,7 +108,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 }
 
 #ifdef CONFIG_SMP
-void smp_kgdb_capture_client(struct pt_regs *regs)
+void smp_kgdb_capture_client(int irq, struct pt_regs *regs)
 {
        unsigned long flags;
 
index 1ade3d6fb7fc7d1bd748a7c47852c027328efa76..89bf6467f494e432a225e4284f526162c9bec690 100644 (file)
@@ -63,7 +63,13 @@ tl0_irq6:    TRAP_IRQ(smp_call_function_single_client, 6)
 #else
 tl0_irq6:      BTRAP(0x46)
 #endif
-tl0_irq7:      BTRAP(0x47) BTRAP(0x48) BTRAP(0x49)
+tl0_irq7:      BTRAP(0x47)
+#ifdef CONFIG_KGDB
+tl0_irq8:      TRAP_IRQ(smp_kgdb_capture_client, 8)
+#else
+tl0_irq8:      BTRAP(0x48)
+#endif
+tl0_irq9:      BTRAP(0x49)
 tl0_irq10:     BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d)
 tl0_irq14:     TRAP_IRQ(timer_interrupt, 14)
 tl0_irq15:     TRAP_IRQ(handler_irq, 15)
index 86773e89dc1bbf29cf71831948e6d79b5d43188b..f1d76cb5ab75d1cab9949b50697f1a98ed95f9b9 100644 (file)
@@ -681,28 +681,8 @@ xcall_new_mmu_context_version:
 #ifdef CONFIG_KGDB
        .globl          xcall_kgdb_capture
 xcall_kgdb_capture:
-661:   rdpr            %pstate, %g2
-       wrpr            %g2, PSTATE_IG | PSTATE_AG, %pstate
-       .section        .sun4v_2insn_patch, "ax"
-       .word           661b
-       nop
-       nop
-       .previous
-
-       rdpr            %pil, %g2
-       wrpr            %g0, 15, %pil
-       sethi           %hi(109f), %g7
-       ba,pt           %xcc, etrap_irq
-109:    or             %g7, %lo(109b), %g7
-#ifdef CONFIG_TRACE_IRQFLAGS
-       call            trace_hardirqs_off
-        nop
-#endif
-       call            smp_kgdb_capture_client
-        add            %sp, PTREGS_OFF, %o0
-       /* Has to be a non-v9 branch due to the large distance. */
-       ba              rtrap_xcall
-        ldx            [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
+       wr              %g0, (1 << PIL_KGDB_CAPTURE), %set_softint
+       retry
 #endif
 
 #endif /* CONFIG_SMP */