diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-11 17:00:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-11 17:00:27 -0500 |
commit | f2d6cff7f5255985939fb752daee4fab397ed61d (patch) | |
tree | 0dee8087cce187ad3272f9cc18457e879ffd78c9 /arch/sparc/kernel | |
parent | 803bf5ec259941936262d10ecc84511b76a20921 (diff) | |
parent | 440ab7ac2d6b735fb278a1ff1674f6716314c6bb (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:
sparc32: Fix thinko in previous change.
sparc: Align clone and signal stacks to 16 bytes.
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/process_32.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/process_64.c | 8 | ||||
-rw-r--r-- | arch/sparc/kernel/signal32.c | 10 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 8 |
5 files changed, 20 insertions, 14 deletions
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index 2830b415e214..c49865b30719 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -526,7 +526,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
526 | * Set some valid stack frames to give to the child. | 526 | * Set some valid stack frames to give to the child. |
527 | */ | 527 | */ |
528 | childstack = (struct sparc_stackf __user *) | 528 | childstack = (struct sparc_stackf __user *) |
529 | (sp & ~0x7UL); | 529 | (sp & ~0xfUL); |
530 | parentstack = (struct sparc_stackf __user *) | 530 | parentstack = (struct sparc_stackf __user *) |
531 | regs->u_regs[UREG_FP]; | 531 | regs->u_regs[UREG_FP]; |
532 | 532 | ||
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index c3f1cce0e95e..cb70476bd8f5 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -398,11 +398,11 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) | |||
398 | } else | 398 | } else |
399 | __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); | 399 | __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); |
400 | 400 | ||
401 | /* Now 8-byte align the stack as this is mandatory in the | 401 | /* Now align the stack as this is mandatory in the Sparc ABI |
402 | * Sparc ABI due to how register windows work. This hides | 402 | * due to how register windows work. This hides the |
403 | * the restriction from thread libraries etc. -DaveM | 403 | * restriction from thread libraries etc. |
404 | */ | 404 | */ |
405 | csp &= ~7UL; | 405 | csp &= ~15UL; |
406 | 406 | ||
407 | distance = fp - psp; | 407 | distance = fp - psp; |
408 | rval = (csp - distance); | 408 | rval = (csp - distance); |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index ba5b09ad6666..ea22cd373c64 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -120,8 +120,8 @@ struct rt_signal_frame32 { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | /* Align macros */ | 122 | /* Align macros */ |
123 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7))) | 123 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 15) & (~15))) |
124 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7))) | 124 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 15) & (~15))) |
125 | 125 | ||
126 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | 126 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
127 | { | 127 | { |
@@ -420,15 +420,17 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns | |||
420 | sp = current->sas_ss_sp + current->sas_ss_size; | 420 | sp = current->sas_ss_sp + current->sas_ss_size; |
421 | } | 421 | } |
422 | 422 | ||
423 | sp -= framesize; | ||
424 | |||
423 | /* Always align the stack frame. This handles two cases. First, | 425 | /* Always align the stack frame. This handles two cases. First, |
424 | * sigaltstack need not be mindful of platform specific stack | 426 | * sigaltstack need not be mindful of platform specific stack |
425 | * alignment. Second, if we took this signal because the stack | 427 | * alignment. Second, if we took this signal because the stack |
426 | * is not aligned properly, we'd like to take the signal cleanly | 428 | * is not aligned properly, we'd like to take the signal cleanly |
427 | * and report that. | 429 | * and report that. |
428 | */ | 430 | */ |
429 | sp &= ~7UL; | 431 | sp &= ~15UL; |
430 | 432 | ||
431 | return (void __user *)(sp - framesize); | 433 | return (void __user *) sp; |
432 | } | 434 | } |
433 | 435 | ||
434 | static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | 436 | static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 7ce1a1005b1d..9882df92ba0a 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -267,15 +267,17 @@ static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *re | |||
267 | sp = current->sas_ss_sp + current->sas_ss_size; | 267 | sp = current->sas_ss_sp + current->sas_ss_size; |
268 | } | 268 | } |
269 | 269 | ||
270 | sp -= framesize; | ||
271 | |||
270 | /* Always align the stack frame. This handles two cases. First, | 272 | /* Always align the stack frame. This handles two cases. First, |
271 | * sigaltstack need not be mindful of platform specific stack | 273 | * sigaltstack need not be mindful of platform specific stack |
272 | * alignment. Second, if we took this signal because the stack | 274 | * alignment. Second, if we took this signal because the stack |
273 | * is not aligned properly, we'd like to take the signal cleanly | 275 | * is not aligned properly, we'd like to take the signal cleanly |
274 | * and report that. | 276 | * and report that. |
275 | */ | 277 | */ |
276 | sp &= ~7UL; | 278 | sp &= ~15UL; |
277 | 279 | ||
278 | return (void __user *)(sp - framesize); | 280 | return (void __user *) sp; |
279 | } | 281 | } |
280 | 282 | ||
281 | static inline int | 283 | static inline int |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 647afbda7ae1..9fa48c30037e 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -353,7 +353,7 @@ segv: | |||
353 | /* Checks if the fp is valid */ | 353 | /* Checks if the fp is valid */ |
354 | static int invalid_frame_pointer(void __user *fp, int fplen) | 354 | static int invalid_frame_pointer(void __user *fp, int fplen) |
355 | { | 355 | { |
356 | if (((unsigned long) fp) & 7) | 356 | if (((unsigned long) fp) & 15) |
357 | return 1; | 357 | return 1; |
358 | return 0; | 358 | return 0; |
359 | } | 359 | } |
@@ -396,15 +396,17 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs * | |||
396 | sp = current->sas_ss_sp + current->sas_ss_size; | 396 | sp = current->sas_ss_sp + current->sas_ss_size; |
397 | } | 397 | } |
398 | 398 | ||
399 | sp -= framesize; | ||
400 | |||
399 | /* Always align the stack frame. This handles two cases. First, | 401 | /* Always align the stack frame. This handles two cases. First, |
400 | * sigaltstack need not be mindful of platform specific stack | 402 | * sigaltstack need not be mindful of platform specific stack |
401 | * alignment. Second, if we took this signal because the stack | 403 | * alignment. Second, if we took this signal because the stack |
402 | * is not aligned properly, we'd like to take the signal cleanly | 404 | * is not aligned properly, we'd like to take the signal cleanly |
403 | * and report that. | 405 | * and report that. |
404 | */ | 406 | */ |
405 | sp &= ~7UL; | 407 | sp &= ~15UL; |
406 | 408 | ||
407 | return (void __user *)(sp - framesize); | 409 | return (void __user *) sp; |
408 | } | 410 | } |
409 | 411 | ||
410 | static inline void | 412 | static inline void |