qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6419] mips: limit RAM size to 256MB on malta and qemu boards
Date: Sat, 24 Jan 2009 15:07:25 +0000	[thread overview]
Message-ID: <E1LQk6X-0000Rj-SA@cvs.savannah.gnu.org> (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).

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

                 reply	other threads:[~2009-01-24 15:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LQk6X-0000Rj-SA@cvs.savannah.gnu.org \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).