Commit 49a84965 authored by Becky Bruce's avatar Becky Bruce Committed by Benjamin Herrenschmidt

powerpc: Allow mem=x cmdline to work with 4G+

We're currently choking on mem=4g (and above) due to memory_limit
being specified as an unsigned long. Make memory_limit
phys_addr_t to fix this.
Signed-off-by: default avatarBecky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 31207dab
...@@ -212,7 +212,7 @@ extern struct task_struct *_switch(struct thread_struct *prev, ...@@ -212,7 +212,7 @@ extern struct task_struct *_switch(struct thread_struct *prev,
extern unsigned int rtas_data; extern unsigned int rtas_data;
extern int mem_init_done; /* set on boot once kmalloc can be called */ extern int mem_init_done; /* set on boot once kmalloc can be called */
extern int init_bootmem_done; /* set on !NUMA once bootmem is available */ extern int init_bootmem_done; /* set on !NUMA once bootmem is available */
extern unsigned long memory_limit; extern phys_addr_t memory_limit;
extern unsigned long klimit; extern unsigned long klimit;
extern void *alloc_maybe_bootmem(size_t size, gfp_t mask); extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
......
...@@ -125,8 +125,8 @@ void __init reserve_crashkernel(void) ...@@ -125,8 +125,8 @@ void __init reserve_crashkernel(void)
/* Crash kernel trumps memory limit */ /* Crash kernel trumps memory limit */
if (memory_limit && memory_limit <= crashk_res.end) { if (memory_limit && memory_limit <= crashk_res.end) {
memory_limit = crashk_res.end + 1; memory_limit = crashk_res.end + 1;
printk("Adjusted memory limit for crashkernel, now 0x%lx\n", printk("Adjusted memory limit for crashkernel, now 0x%llx\n",
memory_limit); (unsigned long long)memory_limit);
} }
printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
......
...@@ -426,7 +426,7 @@ static int __init early_parse_mem(char *p) ...@@ -426,7 +426,7 @@ static int __init early_parse_mem(char *p)
return 1; return 1;
memory_limit = PAGE_ALIGN(memparse(p, &p)); memory_limit = PAGE_ALIGN(memparse(p, &p));
DBG("memory limit = 0x%lx\n", memory_limit); DBG("memory limit = 0x%llx\n", (unsigned long long)memory_limit);
return 0; return 0;
} }
...@@ -1160,7 +1160,7 @@ static inline void __init phyp_dump_reserve_mem(void) {} ...@@ -1160,7 +1160,7 @@ static inline void __init phyp_dump_reserve_mem(void) {}
void __init early_init_devtree(void *params) void __init early_init_devtree(void *params)
{ {
unsigned long limit; phys_addr_t limit;
DBG(" -> early_init_devtree(%p)\n", params); DBG(" -> early_init_devtree(%p)\n", params);
...@@ -1204,7 +1204,7 @@ void __init early_init_devtree(void *params) ...@@ -1204,7 +1204,7 @@ void __init early_init_devtree(void *params)
limit = memory_limit; limit = memory_limit;
if (! limit) { if (! limit) {
unsigned long memsize; phys_addr_t memsize;
/* Ensure that total memory size is page-aligned, because /* Ensure that total memory size is page-aligned, because
* otherwise mark_bootmem() gets upset. */ * otherwise mark_bootmem() gets upset. */
...@@ -1218,7 +1218,7 @@ void __init early_init_devtree(void *params) ...@@ -1218,7 +1218,7 @@ void __init early_init_devtree(void *params)
lmb_analyze(); lmb_analyze();
lmb_dump_all(); lmb_dump_all();
DBG("Phys. mem: %lx\n", lmb_phys_mem_size()); DBG("Phys. mem: %llx\n", lmb_phys_mem_size());
/* We may need to relocate the flat tree, do it now. /* We may need to relocate the flat tree, do it now.
* FIXME .. and the initrd too? */ * FIXME .. and the initrd too? */
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
int init_bootmem_done; int init_bootmem_done;
int mem_init_done; int mem_init_done;
unsigned long memory_limit; phys_addr_t memory_limit;
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
pte_t *kmap_pte; pte_t *kmap_pte;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment