qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6419] mips: limit RAM size to 256MB on malta and qemu boards
@ 2009-01-24 15:07 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2009-01-24 15:07 UTC (permalink / raw)
  To: qemu-devel

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).

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Modified Paths:
--------------
    trunk/hw/mips_malta.c
    trunk/hw/mips_r4k.c

Modified: trunk/hw/mips_malta.c
===================================================================
--- trunk/hw/mips_malta.c	2009-01-24 15:07:09 UTC (rev 6418)
+++ trunk/hw/mips_malta.c	2009-01-24 15:07:25 UTC (rev 6419)
@@ -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
===================================================================
--- trunk/hw/mips_r4k.c	2009-01-24 15:07:09 UTC (rev 6418)
+++ trunk/hw/mips_r4k.c	2009-01-24 15:07:25 UTC (rev 6419)
@@ -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) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-24 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-24 15:07 [Qemu-devel] [6419] mips: limit RAM size to 256MB on malta and qemu boards Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).