diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2008-01-26 08:11:00 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:11:12 -0500 |
commit | 5fd9c6e214547a32d3da6ee4284c79004d667bc8 (patch) | |
tree | def2e218393c9867e9db939f1d379c005895a912 /arch/s390/kernel/setup.c | |
parent | 8ffd74a0924e4e04f6455eb2d2187a9564678d01 (diff) |
[S390] Change vmalloc defintions
Currently the vmalloc area starts at a dynamic address depending on
the memory size. There was also an 8MB security hole after the
physical memory to catch out-of-bounds accesses.
We can simplify the code by putting the vmalloc area explicitely at
the top of the kernel mapping and setting the vmalloc size to a fixed
value of 128MB/128GB for 31bit/64bit systems. Part of the vmalloc
area will be used for the vmem_map. This leaves an area of 96MB/1GB
for normal vmalloc allocations.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r-- | arch/s390/kernel/setup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index d68a4025486e..d071a81b62da 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -617,7 +617,7 @@ EXPORT_SYMBOL_GPL(real_memory_size); | |||
617 | static void __init setup_memory_end(void) | 617 | static void __init setup_memory_end(void) |
618 | { | 618 | { |
619 | unsigned long memory_size; | 619 | unsigned long memory_size; |
620 | unsigned long max_mem, max_phys; | 620 | unsigned long max_mem; |
621 | int i; | 621 | int i; |
622 | 622 | ||
623 | #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) | 623 | #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) |
@@ -625,10 +625,10 @@ static void __init setup_memory_end(void) | |||
625 | memory_end = ZFCPDUMP_HSA_SIZE; | 625 | memory_end = ZFCPDUMP_HSA_SIZE; |
626 | #endif | 626 | #endif |
627 | memory_size = 0; | 627 | memory_size = 0; |
628 | max_phys = VMALLOC_END_INIT - VMALLOC_MIN_SIZE; | ||
629 | memory_end &= PAGE_MASK; | 628 | memory_end &= PAGE_MASK; |
630 | 629 | ||
631 | max_mem = memory_end ? min(max_phys, memory_end) : max_phys; | 630 | max_mem = memory_end ? min(VMALLOC_START, memory_end) : VMALLOC_START; |
631 | memory_end = min(max_mem, memory_end); | ||
632 | 632 | ||
633 | for (i = 0; i < MEMORY_CHUNKS; i++) { | 633 | for (i = 0; i < MEMORY_CHUNKS; i++) { |
634 | struct mem_chunk *chunk = &memory_chunk[i]; | 634 | struct mem_chunk *chunk = &memory_chunk[i]; |