diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 11:03:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 11:03:48 -0400 |
commit | c07724e5b868c603f2a65f3855c77b23454db3ed (patch) | |
tree | 658b1f0af5966e418f48a53e8b2f97e10b250f4f /arch/sparc | |
parent | 302f5bc54448bd2b37d5a8be9b6abc29397827ef (diff) | |
parent | e69f58c037ab5b166b3858fa7b5d7fa470613e8f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* 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
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/Kconfig | 3 | ||||
-rw-r--r-- | arch/sparc/include/asm/jump_label.h | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/irq_32.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/leon_smp.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/rtrap_32.S | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/rtrap_64.S | 36 | ||||
-rw-r--r-- | arch/sparc/mm/fault_32.c | 12 |
7 files changed, 22 insertions, 44 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index a9aaed3c3d97..45d9c87d083a 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -22,8 +22,6 @@ config SPARC | |||
22 | select RTC_CLASS | 22 | select RTC_CLASS |
23 | select RTC_DRV_M48T59 | 23 | select RTC_DRV_M48T59 |
24 | select HAVE_IRQ_WORK | 24 | select HAVE_IRQ_WORK |
25 | select HAVE_PERF_EVENTS | ||
26 | select PERF_USE_VMALLOC | ||
27 | select HAVE_DMA_ATTRS | 25 | select HAVE_DMA_ATTRS |
28 | select HAVE_DMA_API_DEBUG | 26 | select HAVE_DMA_API_DEBUG |
29 | select HAVE_ARCH_JUMP_LABEL | 27 | select HAVE_ARCH_JUMP_LABEL |
@@ -50,7 +48,6 @@ config SPARC64 | |||
50 | select RTC_DRV_BQ4802 | 48 | select RTC_DRV_BQ4802 |
51 | select RTC_DRV_SUN4V | 49 | select RTC_DRV_SUN4V |
52 | select RTC_DRV_STARFIRE | 50 | select RTC_DRV_STARFIRE |
53 | select HAVE_IRQ_WORK | ||
54 | select HAVE_PERF_EVENTS | 51 | select HAVE_PERF_EVENTS |
55 | select PERF_USE_VMALLOC | 52 | select PERF_USE_VMALLOC |
56 | 53 | ||
diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h index 62e66d7b2fb6..65c0d3029796 100644 --- a/arch/sparc/include/asm/jump_label.h +++ b/arch/sparc/include/asm/jump_label.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <asm/system.h> | ||
8 | 7 | ||
9 | #define JUMP_LABEL_NOP_SIZE 4 | 8 | #define JUMP_LABEL_NOP_SIZE 4 |
10 | 9 | ||
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index 0116d8d10def..5ad6e5c5dbb3 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c | |||
@@ -365,7 +365,7 @@ static int request_fast_irq(unsigned int irq, | |||
365 | unsigned long flags; | 365 | unsigned long flags; |
366 | unsigned int cpu_irq; | 366 | unsigned int cpu_irq; |
367 | int ret; | 367 | int ret; |
368 | #ifdef CONFIG_SMP | 368 | #if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON |
369 | struct tt_entry *trap_table; | 369 | struct tt_entry *trap_table; |
370 | extern struct tt_entry trapbase_cpu1, trapbase_cpu2, trapbase_cpu3; | 370 | extern struct tt_entry trapbase_cpu1, trapbase_cpu2, trapbase_cpu3; |
371 | #endif | 371 | #endif |
@@ -425,7 +425,7 @@ static int request_fast_irq(unsigned int irq, | |||
425 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP; | 425 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP; |
426 | 426 | ||
427 | INSTANTIATE(sparc_ttable) | 427 | INSTANTIATE(sparc_ttable) |
428 | #ifdef CONFIG_SMP | 428 | #if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON |
429 | trap_table = &trapbase_cpu1; INSTANTIATE(trap_table) | 429 | trap_table = &trapbase_cpu1; INSTANTIATE(trap_table) |
430 | trap_table = &trapbase_cpu2; INSTANTIATE(trap_table) | 430 | trap_table = &trapbase_cpu2; INSTANTIATE(trap_table) |
431 | trap_table = &trapbase_cpu3; INSTANTIATE(trap_table) | 431 | trap_table = &trapbase_cpu3; INSTANTIATE(trap_table) |
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index e1656fc41ccb..7524689b03d2 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c | |||
@@ -56,8 +56,8 @@ void __init leon_configure_cache_smp(void); | |||
56 | static inline unsigned long do_swap(volatile unsigned long *ptr, | 56 | static inline unsigned long do_swap(volatile unsigned long *ptr, |
57 | unsigned long val) | 57 | unsigned long val) |
58 | { | 58 | { |
59 | __asm__ __volatile__("swapa [%1] %2, %0\n\t" : "=&r"(val) | 59 | __asm__ __volatile__("swapa [%2] %3, %0\n\t" : "=&r"(val) |
60 | : "r"(ptr), "i"(ASI_LEON_DCACHE_MISS) | 60 | : "0"(val), "r"(ptr), "i"(ASI_LEON_DCACHE_MISS) |
61 | : "memory"); | 61 | : "memory"); |
62 | return val; | 62 | return val; |
63 | } | 63 | } |
diff --git a/arch/sparc/kernel/rtrap_32.S b/arch/sparc/kernel/rtrap_32.S index 4da2e1f66290..5f5f74c2c2ca 100644 --- a/arch/sparc/kernel/rtrap_32.S +++ b/arch/sparc/kernel/rtrap_32.S | |||
@@ -78,9 +78,9 @@ signal_p: | |||
78 | call do_notify_resume | 78 | call do_notify_resume |
79 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr | 79 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr |
80 | 80 | ||
81 | /* Fall through. */ | 81 | b signal_p |
82 | ld [%sp + STACKFRAME_SZ + PT_PSR], %t_psr | 82 | ld [%curptr + TI_FLAGS], %g2 |
83 | clr %l6 | 83 | |
84 | ret_trap_continue: | 84 | ret_trap_continue: |
85 | sethi %hi(PSR_SYSCALL), %g1 | 85 | sethi %hi(PSR_SYSCALL), %g1 |
86 | andn %t_psr, %g1, %t_psr | 86 | andn %t_psr, %g1, %t_psr |
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S index 090b9e9ad5e3..77f1b95e0806 100644 --- a/arch/sparc/kernel/rtrap_64.S +++ b/arch/sparc/kernel/rtrap_64.S | |||
@@ -34,37 +34,9 @@ __handle_preemption: | |||
34 | __handle_user_windows: | 34 | __handle_user_windows: |
35 | call fault_in_user_windows | 35 | call fault_in_user_windows |
36 | wrpr %g0, RTRAP_PSTATE, %pstate | 36 | wrpr %g0, RTRAP_PSTATE, %pstate |
37 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | 37 | ba,pt %xcc, __handle_preemption_continue |
38 | /* Redo sched+sig checks */ | 38 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate |
39 | ldx [%g6 + TI_FLAGS], %l0 | ||
40 | andcc %l0, _TIF_NEED_RESCHED, %g0 | ||
41 | |||
42 | be,pt %xcc, 1f | ||
43 | nop | ||
44 | call schedule | ||
45 | wrpr %g0, RTRAP_PSTATE, %pstate | ||
46 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | ||
47 | ldx [%g6 + TI_FLAGS], %l0 | ||
48 | |||
49 | 1: andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 | ||
50 | be,pt %xcc, __handle_user_windows_continue | ||
51 | nop | ||
52 | mov %l5, %o1 | ||
53 | add %sp, PTREGS_OFF, %o0 | ||
54 | mov %l0, %o2 | ||
55 | |||
56 | call do_notify_resume | ||
57 | wrpr %g0, RTRAP_PSTATE, %pstate | ||
58 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | ||
59 | /* Signal delivery can modify pt_regs tstate, so we must | ||
60 | * reload it. | ||
61 | */ | ||
62 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 | ||
63 | sethi %hi(0xf << 20), %l4 | ||
64 | and %l1, %l4, %l4 | ||
65 | ba,pt %xcc, __handle_user_windows_continue | ||
66 | 39 | ||
67 | andn %l1, %l4, %l1 | ||
68 | __handle_userfpu: | 40 | __handle_userfpu: |
69 | rd %fprs, %l5 | 41 | rd %fprs, %l5 |
70 | andcc %l5, FPRS_FEF, %g0 | 42 | andcc %l5, FPRS_FEF, %g0 |
@@ -87,7 +59,7 @@ __handle_signal: | |||
87 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 | 59 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 |
88 | sethi %hi(0xf << 20), %l4 | 60 | sethi %hi(0xf << 20), %l4 |
89 | and %l1, %l4, %l4 | 61 | and %l1, %l4, %l4 |
90 | ba,pt %xcc, __handle_signal_continue | 62 | ba,pt %xcc, __handle_preemption_continue |
91 | andn %l1, %l4, %l1 | 63 | andn %l1, %l4, %l1 |
92 | 64 | ||
93 | /* When returning from a NMI (%pil==15) interrupt we want to | 65 | /* When returning from a NMI (%pil==15) interrupt we want to |
@@ -177,11 +149,9 @@ __handle_preemption_continue: | |||
177 | bne,pn %xcc, __handle_preemption | 149 | bne,pn %xcc, __handle_preemption |
178 | andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 | 150 | andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 |
179 | bne,pn %xcc, __handle_signal | 151 | bne,pn %xcc, __handle_signal |
180 | __handle_signal_continue: | ||
181 | ldub [%g6 + TI_WSAVED], %o2 | 152 | ldub [%g6 + TI_WSAVED], %o2 |
182 | brnz,pn %o2, __handle_user_windows | 153 | brnz,pn %o2, __handle_user_windows |
183 | nop | 154 | nop |
184 | __handle_user_windows_continue: | ||
185 | sethi %hi(TSTATE_PEF), %o0 | 155 | sethi %hi(TSTATE_PEF), %o0 |
186 | andcc %l1, %o0, %g0 | 156 | andcc %l1, %o0, %g0 |
187 | 157 | ||
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index bd8601601afa..5b836f5aea90 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c | |||
@@ -539,6 +539,12 @@ do_sigbus: | |||
539 | __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address); | 539 | __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address); |
540 | } | 540 | } |
541 | 541 | ||
542 | static void check_stack_aligned(unsigned long sp) | ||
543 | { | ||
544 | if (sp & 0x7UL) | ||
545 | force_sig(SIGILL, current); | ||
546 | } | ||
547 | |||
542 | void window_overflow_fault(void) | 548 | void window_overflow_fault(void) |
543 | { | 549 | { |
544 | unsigned long sp; | 550 | unsigned long sp; |
@@ -547,6 +553,8 @@ void window_overflow_fault(void) | |||
547 | if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) | 553 | if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) |
548 | force_user_fault(sp + 0x38, 1); | 554 | force_user_fault(sp + 0x38, 1); |
549 | force_user_fault(sp, 1); | 555 | force_user_fault(sp, 1); |
556 | |||
557 | check_stack_aligned(sp); | ||
550 | } | 558 | } |
551 | 559 | ||
552 | void window_underflow_fault(unsigned long sp) | 560 | void window_underflow_fault(unsigned long sp) |
@@ -554,6 +562,8 @@ void window_underflow_fault(unsigned long sp) | |||
554 | if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) | 562 | if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) |
555 | force_user_fault(sp + 0x38, 0); | 563 | force_user_fault(sp + 0x38, 0); |
556 | force_user_fault(sp, 0); | 564 | force_user_fault(sp, 0); |
565 | |||
566 | check_stack_aligned(sp); | ||
557 | } | 567 | } |
558 | 568 | ||
559 | void window_ret_fault(struct pt_regs *regs) | 569 | void window_ret_fault(struct pt_regs *regs) |
@@ -564,4 +574,6 @@ void window_ret_fault(struct pt_regs *regs) | |||
564 | if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) | 574 | if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) |
565 | force_user_fault(sp + 0x38, 0); | 575 | force_user_fault(sp + 0x38, 0); |
566 | force_user_fault(sp, 0); | 576 | force_user_fault(sp, 0); |
577 | |||
578 | check_stack_aligned(sp); | ||
567 | } | 579 | } |