diff options
author | Dave Young <hidave.darkstar@gmail.com> | 2008-08-20 19:43:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-21 04:13:21 -0400 |
commit | e621bd18958ef5dbace3129ebe17a0a475e127d9 (patch) | |
tree | 214b768e7791b60db3e06676d76e01e77e54c791 /include/asm-x86/pgtable_32.h | |
parent | 6a55617ed5d1aa62b850de2cf66f5ede2eef4825 (diff) |
i386: vmalloc size fix
Booting kernel with vmalloc=[any size<=16m] will oops on my pc (i386/1G memory).
BUG_ON in arch/x86/mm/init_32.c triggered:
BUG_ON((unsigned long)high_memory > VMALLOC_START);
It's due to the vm area hole.
In include/asm-x86/pgtable_32.h:
#define VMALLOC_OFFSET (8 * 1024 * 1024)
#define VMALLOC_START (((unsigned long)high_memory + 2 * VMALLOC_OFFSET - 1) \
& ~(VMALLOC_OFFSET - 1))
There's several related point:
1. MAXMEM :
(-__PAGE_OFFSET - __VMALLOC_RESERVE).
The space after VMALLOC_END is included as well, I set it to
(VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
2. VMALLOC_OFFSET is not considered in __VMALLOC_RESERVE
fixed by adding VMALLOC_OFFSET to it.
3. VMALLOC_START :
(((unsigned long)high_memory + 2 * VMALLOC_OFFSET - 1) & ~(VMALLOC_OFFSET - 1))
So it's not always 8M, bigger than 8M possible.
I set it to ((unsigned long)high_memory + VMALLOC_OFFSET)
4. the VMALLOC_RESERVE is an unused macro, so remove it here.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: akpm@linux-foundation.org
Cc: hidave.darkstar@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/asm-x86/pgtable_32.h')
-rw-r--r-- | include/asm-x86/pgtable_32.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index 5c3b26567a95..9bb5269475cc 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h | |||
@@ -56,8 +56,7 @@ void paging_init(void); | |||
56 | * area for the same reason. ;) | 56 | * area for the same reason. ;) |
57 | */ | 57 | */ |
58 | #define VMALLOC_OFFSET (8 * 1024 * 1024) | 58 | #define VMALLOC_OFFSET (8 * 1024 * 1024) |
59 | #define VMALLOC_START (((unsigned long)high_memory + 2 * VMALLOC_OFFSET - 1) \ | 59 | #define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET) |
60 | & ~(VMALLOC_OFFSET - 1)) | ||
61 | #ifdef CONFIG_X86_PAE | 60 | #ifdef CONFIG_X86_PAE |
62 | #define LAST_PKMAP 512 | 61 | #define LAST_PKMAP 512 |
63 | #else | 62 | #else |
@@ -73,6 +72,8 @@ void paging_init(void); | |||
73 | # define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE) | 72 | # define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE) |
74 | #endif | 73 | #endif |
75 | 74 | ||
75 | #define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE) | ||
76 | |||
76 | /* | 77 | /* |
77 | * Define this if things work differently on an i386 and an i486: | 78 | * Define this if things work differently on an i386 and an i486: |
78 | * it will (on an i486) warn about kernel memory accesses that are | 79 | * it will (on an i486) warn about kernel memory accesses that are |