diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 20:22:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 20:22:31 -0400 |
commit | 8e44e4347735229b518cc02938c351428bcd7492 (patch) | |
tree | e2d7b5998fa8ad76948b2e11591f4534f06f7958 /arch/powerpc/kernel/process.c | |
parent | 06aab5a3084e1d825384fa353e6df4c7949c8683 (diff) | |
parent | 09dd3fc19c09f79115267361ecd7d5c5d2c27a3a (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
Fix build of cpm_uart due to core changes
powerpc/8xx: Fix regression introduced by cache coherency rewrite
powerpc/4xx: Fix erroneous xmon warning on PowerPC 4xx
powerpc/mm: Fix 40x and 8xx vs. _PAGE_SPECIAL
powerpc: Cleanup linker script using new linker script macros.
powerpc: Fix ibm,client-architecture-support printout
powerpc: Increase NODES_SHIFT on 64bit from 4 to 8
powerpc/perf_counter: Fix vdso detection
powerpc: Move 64bit heap above 1TB on machines with 1TB segments
powerpc: Change archdata dma_data to a union
powerpc: Rename get_dma_direct_offset get_dma_offset
powerpc/mm: Remove duplicated #include
powerpc/book3e-64: Remove duplicated #include
powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE
powerpc/pmc: Don't access lppaca on Book3E
powerpc: kmalloc failure ignored in vio_build_iommu_table()
hvc_console: Provide (un)locked version for hvc_resize()
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 0a3216433051..1168c5f440ab 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -1165,7 +1165,22 @@ static inline unsigned long brk_rnd(void) | |||
1165 | 1165 | ||
1166 | unsigned long arch_randomize_brk(struct mm_struct *mm) | 1166 | unsigned long arch_randomize_brk(struct mm_struct *mm) |
1167 | { | 1167 | { |
1168 | unsigned long ret = PAGE_ALIGN(mm->brk + brk_rnd()); | 1168 | unsigned long base = mm->brk; |
1169 | unsigned long ret; | ||
1170 | |||
1171 | #ifdef CONFIG_PPC64 | ||
1172 | /* | ||
1173 | * If we are using 1TB segments and we are allowed to randomise | ||
1174 | * the heap, we can put it above 1TB so it is backed by a 1TB | ||
1175 | * segment. Otherwise the heap will be in the bottom 1TB | ||
1176 | * which always uses 256MB segments and this may result in a | ||
1177 | * performance penalty. | ||
1178 | */ | ||
1179 | if (!is_32bit_task() && (mmu_highuser_ssize == MMU_SEGSIZE_1T)) | ||
1180 | base = max_t(unsigned long, mm->brk, 1UL << SID_SHIFT_1T); | ||
1181 | #endif | ||
1182 | |||
1183 | ret = PAGE_ALIGN(base + brk_rnd()); | ||
1169 | 1184 | ||
1170 | if (ret < mm->brk) | 1185 | if (ret < mm->brk) |
1171 | return mm->brk; | 1186 | return mm->brk; |