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:
sparc32: Fix thinko in previous change.
sparc: Align clone and signal stacks to 16 bytes.

+20 -14
+1 -1
arch/sparc/kernel/process_32.c
··· 526 * Set some valid stack frames to give to the child. 527 */ 528 childstack = (struct sparc_stackf __user *) 529 - (sp & ~0x7UL); 530 parentstack = (struct sparc_stackf __user *) 531 regs->u_regs[UREG_FP]; 532
··· 526 * Set some valid stack frames to give to the child. 527 */ 528 childstack = (struct sparc_stackf __user *) 529 + (sp & ~0xfUL); 530 parentstack = (struct sparc_stackf __user *) 531 regs->u_regs[UREG_FP]; 532
+4 -4
arch/sparc/kernel/process_64.c
··· 398 } else 399 __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); 400 401 - /* Now 8-byte align the stack as this is mandatory in the 402 - * Sparc ABI due to how register windows work. This hides 403 - * the restriction from thread libraries etc. -DaveM 404 */ 405 - csp &= ~7UL; 406 407 distance = fp - psp; 408 rval = (csp - distance);
··· 398 } else 399 __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); 400 401 + /* Now align the stack as this is mandatory in the Sparc ABI 402 + * due to how register windows work. This hides the 403 + * restriction from thread libraries etc. 404 */ 405 + csp &= ~15UL; 406 407 distance = fp - psp; 408 rval = (csp - distance);
+6 -4
arch/sparc/kernel/signal32.c
··· 120 }; 121 122 /* Align macros */ 123 - #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7))) 124 - #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7))) 125 126 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) 127 { ··· 420 sp = current->sas_ss_sp + current->sas_ss_size; 421 } 422 423 /* Always align the stack frame. This handles two cases. First, 424 * sigaltstack need not be mindful of platform specific stack 425 * alignment. Second, if we took this signal because the stack 426 * is not aligned properly, we'd like to take the signal cleanly 427 * and report that. 428 */ 429 - sp &= ~7UL; 430 431 - return (void __user *)(sp - framesize); 432 } 433 434 static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
··· 120 }; 121 122 /* Align macros */ 123 + #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 15) & (~15))) 124 + #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 15) & (~15))) 125 126 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) 127 { ··· 420 sp = current->sas_ss_sp + current->sas_ss_size; 421 } 422 423 + sp -= framesize; 424 + 425 /* Always align the stack frame. This handles two cases. First, 426 * sigaltstack need not be mindful of platform specific stack 427 * alignment. Second, if we took this signal because the stack 428 * is not aligned properly, we'd like to take the signal cleanly 429 * and report that. 430 */ 431 + sp &= ~15UL; 432 433 + return (void __user *) sp; 434 } 435 436 static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
+4 -2
arch/sparc/kernel/signal_32.c
··· 267 sp = current->sas_ss_sp + current->sas_ss_size; 268 } 269 270 /* Always align the stack frame. This handles two cases. First, 271 * sigaltstack need not be mindful of platform specific stack 272 * alignment. Second, if we took this signal because the stack 273 * is not aligned properly, we'd like to take the signal cleanly 274 * and report that. 275 */ 276 - sp &= ~7UL; 277 278 - return (void __user *)(sp - framesize); 279 } 280 281 static inline int
··· 267 sp = current->sas_ss_sp + current->sas_ss_size; 268 } 269 270 + sp -= framesize; 271 + 272 /* Always align the stack frame. This handles two cases. First, 273 * sigaltstack need not be mindful of platform specific stack 274 * alignment. Second, if we took this signal because the stack 275 * is not aligned properly, we'd like to take the signal cleanly 276 * and report that. 277 */ 278 + sp &= ~15UL; 279 280 + return (void __user *) sp; 281 } 282 283 static inline int
+5 -3
arch/sparc/kernel/signal_64.c
··· 353 /* Checks if the fp is valid */ 354 static int invalid_frame_pointer(void __user *fp, int fplen) 355 { 356 - if (((unsigned long) fp) & 7) 357 return 1; 358 return 0; 359 } ··· 396 sp = current->sas_ss_sp + current->sas_ss_size; 397 } 398 399 /* Always align the stack frame. This handles two cases. First, 400 * sigaltstack need not be mindful of platform specific stack 401 * alignment. Second, if we took this signal because the stack 402 * is not aligned properly, we'd like to take the signal cleanly 403 * and report that. 404 */ 405 - sp &= ~7UL; 406 407 - return (void __user *)(sp - framesize); 408 } 409 410 static inline void
··· 353 /* Checks if the fp is valid */ 354 static int invalid_frame_pointer(void __user *fp, int fplen) 355 { 356 + if (((unsigned long) fp) & 15) 357 return 1; 358 return 0; 359 } ··· 396 sp = current->sas_ss_sp + current->sas_ss_size; 397 } 398 399 + sp -= framesize; 400 + 401 /* Always align the stack frame. This handles two cases. First, 402 * sigaltstack need not be mindful of platform specific stack 403 * alignment. Second, if we took this signal because the stack 404 * is not aligned properly, we'd like to take the signal cleanly 405 * and report that. 406 */ 407 + sp &= ~15UL; 408 409 + return (void __user *) sp; 410 } 411 412 static inline void