]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 15:03:48 +0000 (08:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 15:03:48 +0000 (08:03 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  kbuild: add ARCH=sparc32 target
  sparc32: fix build failure on CONFIG_SPARC_LEON
  sparc: Fixed random SPARC/LEON SMP CPU Stuck problem.
  sparc32: remove CONFIG_HAVE_PERF_EVENTS option
  sparc: don't #include asm/system.h in asm/jump_label.h
  sparc32: Fix unaligned stack handling on trap return.
  sparc: keep calling do_signal() as long as pending signals remain

Makefile
arch/sparc/Kconfig
arch/sparc/include/asm/jump_label.h
arch/sparc/kernel/irq_32.c
arch/sparc/kernel/leon_smp.c
arch/sparc/kernel/rtrap_32.S
arch/sparc/kernel/rtrap_64.S
arch/sparc/mm/fault_32.c

index 6b23f1b15fc473b0226bf8525b48a8a3a17c8b28..519db43052a047f175501cca984d8058cf382b1c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -204,6 +204,9 @@ ifeq ($(ARCH),x86_64)
 endif
 
 # Additional ARCH settings for sparc
+ifeq ($(ARCH),sparc32)
+       SRCARCH := sparc
+endif
 ifeq ($(ARCH),sparc64)
        SRCARCH := sparc
 endif
index a9aaed3c3d97b92be15c9fb024bba293a8970428..45d9c87d083ad89343b7c7862c5b62a911f86c2f 100644 (file)
@@ -22,8 +22,6 @@ config SPARC
        select RTC_CLASS
        select RTC_DRV_M48T59
        select HAVE_IRQ_WORK
-       select HAVE_PERF_EVENTS
-       select PERF_USE_VMALLOC
        select HAVE_DMA_ATTRS
        select HAVE_DMA_API_DEBUG
        select HAVE_ARCH_JUMP_LABEL
@@ -50,7 +48,6 @@ config SPARC64
        select RTC_DRV_BQ4802
        select RTC_DRV_SUN4V
        select RTC_DRV_STARFIRE
-       select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
        select PERF_USE_VMALLOC
 
index 62e66d7b2fb62b40ed025b842e99e7d8382b017b..65c0d3029796e0d09a06939f9f3cb19b2deef8bc 100644 (file)
@@ -4,7 +4,6 @@
 #ifdef __KERNEL__
 
 #include <linux/types.h>
-#include <asm/system.h>
 
 #define JUMP_LABEL_NOP_SIZE 4
 
index 0116d8d10def21a4ad9c3b73c27a95383ae4cdc2..5ad6e5c5dbb3b91cef1e6dfded9f4ca55552bd71 100644 (file)
@@ -365,7 +365,7 @@ static int request_fast_irq(unsigned int irq,
        unsigned long flags;
        unsigned int cpu_irq;
        int ret;
-#ifdef CONFIG_SMP
+#if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON
        struct tt_entry *trap_table;
        extern struct tt_entry trapbase_cpu1, trapbase_cpu2, trapbase_cpu3;
 #endif
@@ -425,7 +425,7 @@ static int request_fast_irq(unsigned int irq,
        table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
 
        INSTANTIATE(sparc_ttable)
-#ifdef CONFIG_SMP
+#if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON
        trap_table = &trapbase_cpu1; INSTANTIATE(trap_table)
        trap_table = &trapbase_cpu2; INSTANTIATE(trap_table)
        trap_table = &trapbase_cpu3; INSTANTIATE(trap_table)
index e1656fc41ccbc275dece71ed001a2bead7005ac8..7524689b03d24465f78500f87e804803509b3367 100644 (file)
@@ -56,8 +56,8 @@ void __init leon_configure_cache_smp(void);
 static inline unsigned long do_swap(volatile unsigned long *ptr,
                                    unsigned long val)
 {
-       __asm__ __volatile__("swapa [%1] %2, %0\n\t" : "=&r"(val)
-                            : "r"(ptr), "i"(ASI_LEON_DCACHE_MISS)
+       __asm__ __volatile__("swapa [%2] %3, %0\n\t" : "=&r"(val)
+                            : "0"(val), "r"(ptr), "i"(ASI_LEON_DCACHE_MISS)
                             : "memory");
        return val;
 }
index 4da2e1f6629091ea60e7bccd81fc95b495ae065d..5f5f74c2c2ca5ebf19f7acaca91559c487304533 100644 (file)
@@ -78,9 +78,9 @@ signal_p:
        call    do_notify_resume
         add    %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr
 
-       /* Fall through. */
-       ld      [%sp + STACKFRAME_SZ + PT_PSR], %t_psr
-       clr     %l6
+       b       signal_p
+        ld     [%curptr + TI_FLAGS], %g2
+
 ret_trap_continue:
        sethi   %hi(PSR_SYSCALL), %g1
        andn    %t_psr, %g1, %t_psr
index 090b9e9ad5e36a416258e003be80556b49330a62..77f1b95e0806bb92dc19fd421acd6f159e7dfab0 100644 (file)
@@ -34,37 +34,9 @@ __handle_preemption:
 __handle_user_windows:
                call                    fault_in_user_windows
                 wrpr                   %g0, RTRAP_PSTATE, %pstate
-               wrpr                    %g0, RTRAP_PSTATE_IRQOFF, %pstate
-               /* Redo sched+sig checks */
-               ldx                     [%g6 + TI_FLAGS], %l0
-               andcc                   %l0, _TIF_NEED_RESCHED, %g0
-
-               be,pt                   %xcc, 1f
-                nop
-               call                    schedule
-                wrpr                   %g0, RTRAP_PSTATE, %pstate
-               wrpr                    %g0, RTRAP_PSTATE_IRQOFF, %pstate
-               ldx                     [%g6 + TI_FLAGS], %l0
-
-1:             andcc                   %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0
-               be,pt                   %xcc, __handle_user_windows_continue
-                nop
-               mov                     %l5, %o1
-               add                     %sp, PTREGS_OFF, %o0
-               mov                     %l0, %o2
-
-               call                    do_notify_resume
-                wrpr                   %g0, RTRAP_PSTATE, %pstate
-               wrpr                    %g0, RTRAP_PSTATE_IRQOFF, %pstate
-               /* Signal delivery can modify pt_regs tstate, so we must
-                * reload it.
-                */
-               ldx                     [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
-               sethi                   %hi(0xf << 20), %l4
-               and                     %l1, %l4, %l4
-               ba,pt                   %xcc, __handle_user_windows_continue
+               ba,pt                   %xcc, __handle_preemption_continue
+                wrpr                   %g0, RTRAP_PSTATE_IRQOFF, %pstate
 
-                andn                   %l1, %l4, %l1
 __handle_userfpu:
                rd                      %fprs, %l5
                andcc                   %l5, FPRS_FEF, %g0
@@ -87,7 +59,7 @@ __handle_signal:
                ldx                     [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
                sethi                   %hi(0xf << 20), %l4
                and                     %l1, %l4, %l4
-               ba,pt                   %xcc, __handle_signal_continue
+               ba,pt                   %xcc, __handle_preemption_continue
                 andn                   %l1, %l4, %l1
 
                /* When returning from a NMI (%pil==15) interrupt we want to
@@ -177,11 +149,9 @@ __handle_preemption_continue:
                bne,pn                  %xcc, __handle_preemption
                 andcc                  %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0
                bne,pn                  %xcc, __handle_signal
-__handle_signal_continue:
                 ldub                   [%g6 + TI_WSAVED], %o2
                brnz,pn                 %o2, __handle_user_windows
                 nop
-__handle_user_windows_continue:
                sethi                   %hi(TSTATE_PEF), %o0
                andcc                   %l1, %o0, %g0
 
index bd8601601afab05ffc9f0ff7d06021523355b69f..5b836f5aea90bcd94d4e4ba1b3114a8115291135 100644 (file)
@@ -539,6 +539,12 @@ do_sigbus:
        __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address);
 }
 
+static void check_stack_aligned(unsigned long sp)
+{
+       if (sp & 0x7UL)
+               force_sig(SIGILL, current);
+}
+
 void window_overflow_fault(void)
 {
        unsigned long sp;
@@ -547,6 +553,8 @@ void window_overflow_fault(void)
        if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
                force_user_fault(sp + 0x38, 1);
        force_user_fault(sp, 1);
+
+       check_stack_aligned(sp);
 }
 
 void window_underflow_fault(unsigned long sp)
@@ -554,6 +562,8 @@ void window_underflow_fault(unsigned long sp)
        if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
                force_user_fault(sp + 0x38, 0);
        force_user_fault(sp, 0);
+
+       check_stack_aligned(sp);
 }
 
 void window_ret_fault(struct pt_regs *regs)
@@ -564,4 +574,6 @@ void window_ret_fault(struct pt_regs *regs)
        if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
                force_user_fault(sp + 0x38, 0);
        force_user_fault(sp, 0);
+
+       check_stack_aligned(sp);
 }