qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 3/3] hw/hppa/machine: Warn when using more than 4095MB of RAM


From: Philippe Mathieu-Daudé
Subject: [RFC PATCH 3/3] hw/hppa/machine: Warn when using more than 4095MB of RAM
Date: Wed, 8 Jan 2020 19:14:25 +0100

We use SeaBIOS as firmware, and pass the RAM size in a 32-bit
wide register. When using 4GB of RAM, the register is truncated
to 0, SeaBIOS is confused and halts the machine:

  $ qemu-system-hppa -m 4g -serial stdio

  SeaBIOS: Machine configured with too little memory (0 MB), minimum is 16 MB.

  SeaBIOS wants SYSTEM HALT.

Display a warning in case the user is not looking at the serial
console.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 hw/hppa/machine.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index d10c967d06..e74aafea2f 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -159,6 +159,10 @@ static void machine_hppa_init(MachineState *machine)
         exit(1);
     }
     g_free(firmware_filename);
+    if (machine->ram_size > 4095 * MiB) {
+        /* FIXME As we use 32-bit registers, 4GiB is truncated to 0 */
+        warn_report("Firmware might misbehave with 4GB of RAM");
+    }
 
     rom_region = g_new(MemoryRegion, 1);
     memory_region_init_ram(rom_region, NULL, "firmware",
-- 
2.21.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]