diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-10-05 10:52:18 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-10-09 08:17:01 -0400 |
commit | c972cc60c23f5a6309292bfcc91a441743ba027e (patch) | |
tree | 04f8fc1d4e78979d28a897a90bba5c3321555967 /arch/s390/include | |
parent | 021d48be48481821f6e3f53028915c0571874135 (diff) |
s390/vmalloc: have separate modules area
Add a special module area on top of the vmalloc area, which may be only
used for modules and bpf jit generated code.
This makes sure that inter module branches will always happen without a
trampoline and in addition having all the code within a 2GB frame is
branch prediction unit friendly.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/pgtable.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 75b91bb772bd..dd647c919a66 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -119,13 +119,12 @@ static inline int is_zero_pfn(unsigned long pfn) | |||
119 | 119 | ||
120 | #ifndef __ASSEMBLY__ | 120 | #ifndef __ASSEMBLY__ |
121 | /* | 121 | /* |
122 | * The vmalloc area will always be on the topmost area of the kernel | 122 | * The vmalloc and module area will always be on the topmost area of the kernel |
123 | * mapping. We reserve 96MB (31bit) / 128GB (64bit) for vmalloc, | 123 | * mapping. We reserve 96MB (31bit) / 128GB (64bit) for vmalloc and modules. |
124 | * which should be enough for any sane case. | 124 | * On 64 bit kernels we have a 2GB area at the top of the vmalloc area where |
125 | * By putting vmalloc at the top, we maximise the gap between physical | 125 | * modules will reside. That makes sure that inter module branches always |
126 | * memory and vmalloc to catch misplaced memory accesses. As a side | 126 | * happen without trampolines and in addition the placement within a 2GB frame |
127 | * effect, this also makes sure that 64 bit module code cannot be used | 127 | * is branch prediction unit friendly. |
128 | * as system call address. | ||
129 | */ | 128 | */ |
130 | extern unsigned long VMALLOC_START; | 129 | extern unsigned long VMALLOC_START; |
131 | extern unsigned long VMALLOC_END; | 130 | extern unsigned long VMALLOC_END; |
@@ -133,6 +132,14 @@ extern struct page *vmemmap; | |||
133 | 132 | ||
134 | #define VMEM_MAX_PHYS ((unsigned long) vmemmap) | 133 | #define VMEM_MAX_PHYS ((unsigned long) vmemmap) |
135 | 134 | ||
135 | #ifdef CONFIG_64BIT | ||
136 | extern unsigned long MODULES_VADDR; | ||
137 | extern unsigned long MODULES_END; | ||
138 | #define MODULES_VADDR MODULES_VADDR | ||
139 | #define MODULES_END MODULES_END | ||
140 | #define MODULES_LEN (1UL << 31) | ||
141 | #endif | ||
142 | |||
136 | /* | 143 | /* |
137 | * A 31 bit pagetable entry of S390 has following format: | 144 | * A 31 bit pagetable entry of S390 has following format: |
138 | * | PFRA | | OS | | 145 | * | PFRA | | OS | |