diff options
-rw-r--r-- | hw/mips_malta.c | 6 | ||||
-rw-r--r-- | hw/mips_r4k.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/hw/mips_malta.c b/hw/mips_malta.c index 9a41cdf949..ba67947707 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -802,6 +802,12 @@ void mips_malta_init (ram_addr_t ram_size, int vga_ram_size, 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. */ diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c index 34b3853295..1ed123e4e7 100644 --- a/hw/mips_r4k.c +++ b/hw/mips_r4k.c @@ -178,6 +178,12 @@ void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size, 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) { |