diff options
author | Max Filippov | 2014-01-31 02:38:21 +0100 |
---|---|---|
committer | Max Filippov | 2014-02-21 18:33:39 +0100 |
commit | e9d6dca51823b94e1ca28cb5e9180701d4375d61 (patch) | |
tree | 03e96cb5a906e63da33dfcf748d1861814afb5c7 /arch/xtensa | |
parent | Linux 3.14-rc3 (diff) | |
download | kernel-qcow2-linux-e9d6dca51823b94e1ca28cb5e9180701d4375d61.tar.gz kernel-qcow2-linux-e9d6dca51823b94e1ca28cb5e9180701d4375d61.tar.xz kernel-qcow2-linux-e9d6dca51823b94e1ca28cb5e9180701d4375d61.zip |
xtensa: don't pass high memory to bootmem allocator
This fixes panic when booting on machine with more than 128M memory
passed from the bootloader.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/mm/init.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 479d7537a32a..aff108df92d3 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -90,7 +90,7 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist) /* - * Initialize the bootmem system and give it all the memory we have available. + * Initialize the bootmem system and give it all low memory we have available. */ void __init bootmem_init(void) @@ -142,9 +142,14 @@ void __init bootmem_init(void) /* Add all remaining memory pieces into the bootmem map */ - for (i=0; i<sysmem.nr_banks; i++) - free_bootmem(sysmem.bank[i].start, - sysmem.bank[i].end - sysmem.bank[i].start); + for (i = 0; i < sysmem.nr_banks; i++) { + if (sysmem.bank[i].start >> PAGE_SHIFT < max_low_pfn) { + unsigned long end = min(max_low_pfn << PAGE_SHIFT, + sysmem.bank[i].end); + free_bootmem(sysmem.bank[i].start, + end - sysmem.bank[i].start); + } + } } |