1 file changed, 4 insertions(+)
qemu/hw/ppc440_bamboo.c | 4 ++++
This fixes a issue where the amount of memory is not properly being defined in
the device tree. It currently is hardcoded for 144MB. The result is that if you
specify a memory size below the hardcoded size, the guest crashes. This patch
now dynamically changes the device tree to the memory value specified.
Signed-off-by: Jerone Young <[EMAIL PROTECTED]>
diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -50,6 +50,7 @@ void bamboo_init(ram_addr_t ram_size, in
int i=0, k=0;
uint32_t cpu_freq;
uint32_t timebase_freq;
+ uint32_t mem_reg_property[]={0, 0, ram_size};
printf("%s: START\n", __func__);
@@ -73,6 +74,7 @@ void bamboo_init(ram_addr_t ram_size, in
printf("WARNING: %i MB left over memory is ram\n",
bytes_to_mb((int)tmp_ram_size));
ram_size -= tmp_ram_size;
+ mem_reg_property[2] = ram_size;
}
/* Setup CPU */
@@ -159,6 +161,8 @@ void bamboo_init(ram_addr_t ram_size, in
/* manipulate device tree in memory */
dt_cell(fdt, "/cpus/[EMAIL PROTECTED]", "clock-frequency", cpu_freq);
dt_cell(fdt, "/cpus/[EMAIL PROTECTED]", "timebase-frequency",
timebase_freq);
+ dt_cell_multi(fdt, "/memory", "reg", mem_reg_property,
+ sizeof(mem_reg_property));
dt_cell(fdt, "/chosen", "linux,initrd-start", initrd_base);
dt_cell(fdt, "/chosen", "linux,initrd-end",
(initrd_base + initrd_size));
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel