Commit b9c3fdb0 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[POWERPC] Fix parse_drconf_memory() for 64-bit start addresses

Some new machines use the "ibm,dynamic-reconfiguration-memory" property
to provide memory layout information, rather than via memory nodes.

There is a bug in the code to parse this property for start addresses
over 4GB; we store the start address in an unsigned int, which means
we throw away the high bits and add apparently duplicate regions.
This results in a BUG() in free_bootmem_core().  This fixes it by
using an unsigned long instead.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 17aa3a82
...@@ -307,9 +307,9 @@ static void __init parse_drconf_memory(struct device_node *memory) ...@@ -307,9 +307,9 @@ static void __init parse_drconf_memory(struct device_node *memory)
const unsigned int *lm, *dm, *aa; const unsigned int *lm, *dm, *aa;
unsigned int ls, ld, la; unsigned int ls, ld, la;
unsigned int n, aam, aalen; unsigned int n, aam, aalen;
unsigned long lmb_size, size; unsigned long lmb_size, size, start;
int nid, default_nid = 0; int nid, default_nid = 0;
unsigned int start, ai, flags; unsigned int ai, flags;
lm = of_get_property(memory, "ibm,lmb-size", &ls); lm = of_get_property(memory, "ibm,lmb-size", &ls);
dm = of_get_property(memory, "ibm,dynamic-memory", &ld); dm = of_get_property(memory, "ibm,dynamic-memory", &ld);
......
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