* 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.
···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 } else399 __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));400401- /* Now 8-byte align the stack as this is mandatory in the402- * Sparc ABI due to how register windows work. This hides403- * the restriction from thread libraries etc. -DaveM404 */405- csp &= ~7UL;406407 distance = fp - psp;408 rval = (csp - distance);
···398 } else399 __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));400401+ /* Now align the stack as this is mandatory in the Sparc ABI402+ * due to how register windows work. This hides the403+ * restriction from thread libraries etc.404 */405+ csp &= ~15UL;406407 distance = fp - psp;408 rval = (csp - distance);
+6-4
arch/sparc/kernel/signal32.c
···120};121122/* Align macros */123-#define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7)))124-#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7)))125126int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)127{···420 sp = current->sas_ss_sp + current->sas_ss_size;421 }42200423 /* Always align the stack frame. This handles two cases. First,424 * sigaltstack need not be mindful of platform specific stack425 * alignment. Second, if we took this signal because the stack426 * is not aligned properly, we'd like to take the signal cleanly427 * and report that.428 */429- sp &= ~7UL;430431- return (void __user *)(sp - framesize);432}433434static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
···120};121122/* Align macros */123+#define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 15) & (~15)))124+#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 15) & (~15)))125126int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)127{···420 sp = current->sas_ss_sp + current->sas_ss_size;421 }422423+ sp -= framesize;424+425 /* Always align the stack frame. This handles two cases. First,426 * sigaltstack need not be mindful of platform specific stack427 * alignment. Second, if we took this signal because the stack428 * is not aligned properly, we'd like to take the signal cleanly429 * and report that.430 */431+ sp &= ~15UL;432433+ return (void __user *) sp;434}435436static 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 }26900270 /* Always align the stack frame. This handles two cases. First,271 * sigaltstack need not be mindful of platform specific stack272 * alignment. Second, if we took this signal because the stack273 * is not aligned properly, we'd like to take the signal cleanly274 * and report that.275 */276- sp &= ~7UL;277278- return (void __user *)(sp - framesize);279}280281static inline int
···267 sp = current->sas_ss_sp + current->sas_ss_size;268 }269270+ sp -= framesize;271+272 /* Always align the stack frame. This handles two cases. First,273 * sigaltstack need not be mindful of platform specific stack274 * alignment. Second, if we took this signal because the stack275 * is not aligned properly, we'd like to take the signal cleanly276 * and report that.277 */278+ sp &= ~15UL;279280+ return (void __user *) sp;281}282283static inline int
+5-3
arch/sparc/kernel/signal_64.c
···353/* Checks if the fp is valid */354static 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 }39800399 /* Always align the stack frame. This handles two cases. First,400 * sigaltstack need not be mindful of platform specific stack401 * alignment. Second, if we took this signal because the stack402 * is not aligned properly, we'd like to take the signal cleanly403 * and report that.404 */405- sp &= ~7UL;406407- return (void __user *)(sp - framesize);408}409410static inline void
···353/* Checks if the fp is valid */354static 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 }398399+ sp -= framesize;400+401 /* Always align the stack frame. This handles two cases. First,402 * sigaltstack need not be mindful of platform specific stack403 * alignment. Second, if we took this signal because the stack404 * is not aligned properly, we'd like to take the signal cleanly405 * and report that.406 */407+ sp &= ~15UL;408409+ return (void __user *) sp;410}411412static inline void