diff options
author | Nicolas Pitre <nico@cam.org> | 2008-09-19 10:43:06 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-11-28 10:36:47 -0500 |
commit | 9210807cb5a3f19a0e954dd401e3a2c3626d1b48 (patch) | |
tree | d73afb5a664ba8fcbbd0b5e5d48ac5533f7d4da0 | |
parent | 6db015e49c03d42247d2a985475b833635406a4f (diff) |
[ARM] prevent the vmalloc cmdline argument from eating all memory
Commit 8d5796d2ec6b5a4e7a52861144e63af438d6f8f7 allows for the vmalloc
area to be resized from the kernel cmdline. Make sure it cannot overlap
with RAM entirely.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mm/mmu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index ab511d94d917..636cf8fc70ef 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -646,6 +646,13 @@ static void __init early_vmalloc(char **arg) | |||
646 | "vmalloc area too small, limiting to %luMB\n", | 646 | "vmalloc area too small, limiting to %luMB\n", |
647 | vmalloc_reserve >> 20); | 647 | vmalloc_reserve >> 20); |
648 | } | 648 | } |
649 | |||
650 | if (vmalloc_reserve > VMALLOC_END - (PAGE_OFFSET + SZ_32M)) { | ||
651 | vmalloc_reserve = VMALLOC_END - (PAGE_OFFSET + SZ_32M); | ||
652 | printk(KERN_WARNING | ||
653 | "vmalloc area is too big, limiting to %luMB\n", | ||
654 | vmalloc_reserve >> 20); | ||
655 | } | ||
649 | } | 656 | } |
650 | __early_param("vmalloc=", early_vmalloc); | 657 | __early_param("vmalloc=", early_vmalloc); |
651 | 658 | ||