25 #include <linux/personality.h>
27 #include <linux/mman.h>
28 #include <linux/module.h>
29 #include <linux/random.h>
31 #include <asm/pgalloc.h>
33 static unsigned long stack_maxrandom_size(
void)
47 #define MIN_GAP (32*1024*1024)
48 #define MAX_GAP (STACK_TOP/6*5)
50 static inline int mmap_is_legacy(
void)
59 static unsigned long mmap_rnd(
void)
67 static inline unsigned long mmap_base(
void)
76 return STACK_TOP - stack_maxrandom_size() - mmap_rnd() - gap;
91 if (mmap_is_legacy()) {
104 int s390_mmap_check(
unsigned long addr,
unsigned long len)
110 rc = crst_table_upgrade(
current->mm, 1
UL << 53);
119 s390_get_unmapped_area(
struct file *filp,
unsigned long addr,
120 unsigned long len,
unsigned long pgoff,
unsigned long flags)
131 rc = crst_table_upgrade(mm, 1
UL << 53);
133 return (
unsigned long)
rc;
141 s390_get_unmapped_area_topdown(
struct file *filp,
const unsigned long addr,
142 const unsigned long len,
const unsigned long pgoff,
143 const unsigned long flags)
154 rc = crst_table_upgrade(mm, 1
UL << 53);
156 return (
unsigned long)
rc;
173 if (mmap_is_legacy()) {
175 mm->get_unmapped_area = s390_get_unmapped_area;
179 mm->get_unmapped_area = s390_get_unmapped_area_topdown;