aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-05-12 00:23:05 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-12 00:23:05 -0400
commit96061a91a1265d2f8dae6f4a6064bd77faec4df5 (patch)
tree4fe080ca676f05f8f0fa979fed88e47d5e7b23c1 /arch
parent716a5d73a787a3d1f6e2bd8ce34a788bb8bf368f (diff)
sparc32: Restore SMP build and rectify sun4m NMI when non-SMP.
The non-SMP sun4m NMI handler was still accessing SUN4C registers. Fix that and share the sun4m NMI trap code between SMP and non-SMP cases. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/entry.S78
-rw-r--r--arch/sparc/kernel/head_32.S2
2 files changed, 30 insertions, 50 deletions
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index 1b87ea088e1a..4976d655c9c3 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -306,8 +306,8 @@ maybe_smp4m_msg_out:
306 RESTORE_ALL 306 RESTORE_ALL
307 307
308 .align 4 308 .align 4
309 .globl linux_trap_ipi15 309 .globl linux_trap_ipi15_sun4m
310linux_trap_ipi15: 310linux_trap_ipi15_sun4m:
311 SAVE_ALL 311 SAVE_ALL
312 sethi %hi(0x80000000), %o2 312 sethi %hi(0x80000000), %o2
313 GET_PROCESSOR4M_ID(o0) 313 GET_PROCESSOR4M_ID(o0)
@@ -317,7 +317,7 @@ linux_trap_ipi15:
317 ld [%o5 + %o0], %o5 317 ld [%o5 + %o0], %o5
318 ld [%o5 + 0x00], %o3 ! sun4m_irq_percpu[cpu]->pending 318 ld [%o5 + 0x00], %o3 ! sun4m_irq_percpu[cpu]->pending
319 andcc %o3, %o2, %g0 319 andcc %o3, %o2, %g0
320 be 1f ! Must be an NMI async memory error 320 be sun4m_nmi_error ! Must be an NMI async memory error
321 st %o2, [%o5 + 0x04] ! sun4m_irq_percpu[cpu]->clear=0x80000000 321 st %o2, [%o5 + 0x04] ! sun4m_irq_percpu[cpu]->clear=0x80000000
322 WRITE_PAUSE 322 WRITE_PAUSE
323 ld [%o5 + 0x00], %g0 ! sun4m_irq_percpu[cpu]->pending 323 ld [%o5 + 0x00], %g0 ! sun4m_irq_percpu[cpu]->pending
@@ -331,27 +331,6 @@ linux_trap_ipi15:
331 nop 331 nop
332 b ret_trap_lockless_ipi 332 b ret_trap_lockless_ipi
333 clr %l6 333 clr %l6
3341:
335 /* NMI async memory error handling. */
336 sethi %hi(0x80000000), %l4
337 sethi %hi(sun4m_irq_global), %o5
338 ld [%o5 + %lo(sun4m_irq_global)], %l5
339 st %l4, [%l5 + 0x0c] ! sun4m_irq_global->mask_set=0x80000000
340 WRITE_PAUSE
341 ld [%l5 + 0x00], %g0 ! sun4m_irq_global->pending
342 WRITE_PAUSE
343 or %l0, PSR_PIL, %l4
344 wr %l4, 0x0, %psr
345 WRITE_PAUSE
346 wr %l4, PSR_ET, %psr
347 WRITE_PAUSE
348 call sun4m_nmi
349 nop
350 st %l4, [%l5 + 0x08] ! sun4m_irq_global->mask_clear=0x80000000
351 WRITE_PAUSE
352 ld [%l5 + 0x00], %g0 ! sun4m_irq_global->pending
353 WRITE_PAUSE
354 RESTORE_ALL
355 334
356 .globl smp4d_ticker 335 .globl smp4d_ticker
357 /* SMP per-cpu ticker interrupts are handled specially. */ 336 /* SMP per-cpu ticker interrupts are handled specially. */
@@ -749,35 +728,36 @@ setcc_trap_handler:
749 jmp %l2 ! advance over trap instruction 728 jmp %l2 ! advance over trap instruction
750 rett %l2 + 0x4 ! like this... 729 rett %l2 + 0x4 ! like this...
751 730
731sun4m_nmi_error:
732 /* NMI async memory error handling. */
733 sethi %hi(0x80000000), %l4
734 sethi %hi(sun4m_irq_global), %o5
735 ld [%o5 + %lo(sun4m_irq_global)], %l5
736 st %l4, [%l5 + 0x0c] ! sun4m_irq_global->mask_set=0x80000000
737 WRITE_PAUSE
738 ld [%l5 + 0x00], %g0 ! sun4m_irq_global->pending
739 WRITE_PAUSE
740 or %l0, PSR_PIL, %l4
741 wr %l4, 0x0, %psr
742 WRITE_PAUSE
743 wr %l4, PSR_ET, %psr
744 WRITE_PAUSE
745 call sun4m_nmi
746 nop
747 st %l4, [%l5 + 0x08] ! sun4m_irq_global->mask_clear=0x80000000
748 WRITE_PAUSE
749 ld [%l5 + 0x00], %g0 ! sun4m_irq_global->pending
750 WRITE_PAUSE
751 RESTORE_ALL
752
752#ifndef CONFIG_SMP 753#ifndef CONFIG_SMP
753 .align 4 754 .align 4
754 .globl linux_trap_ipi15 755 .globl linux_trap_ipi15_sun4m
755linux_trap_ipi15: 756linux_trap_ipi15_sun4m:
756 SAVE_ALL 757 SAVE_ALL
757 758
758 /* Now it is safe to re-enable traps without recursion. */ 759 ba sun4m_nmi_error
759 or %l0, PSR_PIL, %l0 760 nop
760 wr %l0, PSR_ET, %psr
761 WRITE_PAUSE
762
763 /* Now call the c-code with the pt_regs frame ptr and the
764 * memory error registers as arguments. The ordering chosen
765 * here is due to unlatching semantics.
766 */
767 sethi %hi(AC_SYNC_ERR), %o0
768 add %o0, 0x4, %o0
769 lda [%o0] ASI_CONTROL, %o2 ! sync vaddr
770 sub %o0, 0x4, %o0
771 lda [%o0] ASI_CONTROL, %o1 ! sync error
772 add %o0, 0xc, %o0
773 lda [%o0] ASI_CONTROL, %o4 ! async vaddr
774 sub %o0, 0x4, %o0
775 lda [%o0] ASI_CONTROL, %o3 ! async error
776 call sparc_lvl15_nmi
777 add %sp, STACKFRAME_SZ, %o0
778
779 RESTORE_ALL
780
781#endif /* CONFIG_SMP */ 761#endif /* CONFIG_SMP */
782 762
783 .align 4 763 .align 4
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index 85623f9da6ff..ea45894db0bd 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -111,7 +111,7 @@ t_irq12:TRAP_ENTRY_INTERRUPT(12) /* IRQ Zilog serial chip */
111t_irq13:TRAP_ENTRY_INTERRUPT(13) /* IRQ Audio Intr. */ 111t_irq13:TRAP_ENTRY_INTERRUPT(13) /* IRQ Audio Intr. */
112t_irq14:TRAP_ENTRY_INTERRUPT(14) /* IRQ Timer #2 */ 112t_irq14:TRAP_ENTRY_INTERRUPT(14) /* IRQ Timer #2 */
113 .globl t_nmi 113 .globl t_nmi
114t_nmi: TRAP_ENTRY(0x1f, linux_trap_ipi15) 114t_nmi: TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
115 115
116t_racc: TRAP_ENTRY(0x20, do_reg_access) /* General Register Access Error */ 116t_racc: TRAP_ENTRY(0x20, do_reg_access) /* General Register Access Error */
117t_iacce:BAD_TRAP(0x21) /* Instr Access Error */ 117t_iacce:BAD_TRAP(0x21) /* Instr Access Error */