diff options
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index e4eb472558ca..9eee649449a8 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -466,7 +466,8 @@ error_kill: | |||
466 | #endif | 466 | #endif |
467 | 467 | ||
468 | /* | 468 | /* |
469 | * present useful information to the program | 469 | * present useful information to the program by shovelling it onto the new |
470 | * process's stack | ||
470 | */ | 471 | */ |
471 | static int create_elf_fdpic_tables(struct linux_binprm *bprm, | 472 | static int create_elf_fdpic_tables(struct linux_binprm *bprm, |
472 | struct mm_struct *mm, | 473 | struct mm_struct *mm, |
@@ -482,9 +483,13 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, | |||
482 | int loop; | 483 | int loop; |
483 | int nr; /* reset for each csp adjustment */ | 484 | int nr; /* reset for each csp adjustment */ |
484 | 485 | ||
485 | /* we're going to shovel a whole load of stuff onto the stack */ | ||
486 | #ifdef CONFIG_MMU | 486 | #ifdef CONFIG_MMU |
487 | sp = bprm->p; | 487 | /* In some cases (e.g. Hyper-Threading), we want to avoid L1 evictions |
488 | * by the processes running on the same package. One thing we can do is | ||
489 | * to shuffle the initial stack for them, so we give the architecture | ||
490 | * an opportunity to do so here. | ||
491 | */ | ||
492 | sp = arch_align_stack(bprm->p); | ||
488 | #else | 493 | #else |
489 | sp = mm->start_stack; | 494 | sp = mm->start_stack; |
490 | 495 | ||
@@ -527,20 +532,6 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, | |||
527 | return -EFAULT; | 532 | return -EFAULT; |
528 | } | 533 | } |
529 | 534 | ||
530 | #if defined(__i386__) && defined(CONFIG_SMP) | ||
531 | /* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions | ||
532 | * by the processes running on the same package. One thing we can do is | ||
533 | * to shuffle the initial stack for them. | ||
534 | * | ||
535 | * the conditionals here are unneeded, but kept in to make the code | ||
536 | * behaviour the same as pre change unless we have hyperthreaded | ||
537 | * processors. This keeps Mr Marcelo Person happier but should be | ||
538 | * removed for 2.5 | ||
539 | */ | ||
540 | if (smp_num_siblings > 1) | ||
541 | sp = sp - ((current->pid % 64) << 7); | ||
542 | #endif | ||
543 | |||
544 | sp &= ~7UL; | 535 | sp &= ~7UL; |
545 | 536 | ||
546 | /* stack the load map(s) */ | 537 | /* stack the load map(s) */ |