Skip to contentSkip to conversation

[6419] mips: limit RAM size to 256MB on malta and qemu boards

Qemu-devel Aurelien Jarno 1 participant 1 message Jan 24, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6419

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6419
Author:   aurel32
Date:     2009-01-24 15:07:25 +0000 (Sat, 24 Jan 2009)

Log Message:
-----------
mips: limit RAM size to 256MB on malta and qemu boards

This avoid crash when a bigger RAM size is requested (the devices are mapped at 0x01000000).

Modified Paths:
--------------

    trunk/hw/mips_malta.c
    trunk/hw/mips_r4k.c

Modified: trunk/hw/mips_malta.c
===================================================================

hw/mips_malta.c +6 -0
@@ -802,6 +802,12 @@
     qemu_register_reset(main_cpu_reset, env);
 
     /* allocate RAM */
+    if (ram_size > (256 << 20)) {
+        fprintf(stderr,
+                "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
+                ((unsigned int)ram_size / (1 << 20)));
+        exit(1);
+    }
     cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
 
     /* Map the bios at two physical locations, as on the real board. */

Modified: trunk/hw/mips_r4k.c
===================================================================

hw/mips_r4k.c +6 -0
@@ -178,6 +178,12 @@
     qemu_register_reset(main_cpu_reset, env);
 
     /* allocate RAM */
+    if (ram_size > (256 << 20)) {
+        fprintf(stderr,
+                "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
+                ((unsigned int)ram_size / (1 << 20)));
+        exit(1);
+    }
     cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
 
     if (!mips_qemu_iomemtype) {