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é <f4...@amsat.org>
---
 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