x86: memblock: set current limit to max low memory address
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Tue, 21 Jan 2014 23:50:03 +0000 (15:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Jan 2014 00:19:46 +0000 (16:19 -0800)
The memblock current limit value is used to limit early boot memory
allocations below max low memory address by default, as the kernel can
access only to the low memory.

Hence, set memblock current limit value to the max mapped low memory
address instead of max mapped memory address.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/page_types.h
arch/x86/kernel/setup.c

index f97fbe3abb67f5059d4e6f0a37261d6113df19de..2f59cce3b38aaabb83efe9c528ffbfc7ea9ae8d8 100644 (file)
@@ -51,9 +51,9 @@ extern int devmem_is_allowed(unsigned long pagenr);
 extern unsigned long max_low_pfn_mapped;
 extern unsigned long max_pfn_mapped;
 
-static inline phys_addr_t get_max_mapped(void)
+static inline phys_addr_t get_max_low_mapped(void)
 {
-       return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT;
+       return (phys_addr_t)max_low_pfn_mapped << PAGE_SHIFT;
 }
 
 bool pfn_range_is_mapped(unsigned long start_pfn, unsigned long end_pfn);
index 06853e6703541f8349106e17330f86621fa984db..c9675594d7caee907fd6fd78559fe14bf1aea036 100644 (file)
@@ -1119,7 +1119,7 @@ void __init setup_arch(char **cmdline_p)
 
        setup_real_mode();
 
-       memblock_set_current_limit(get_max_mapped());
+       memblock_set_current_limit(get_max_low_mapped());
        dma_contiguous_reserve(0);
 
        /*