]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/hppa/machine: Correctly check the firmware is in PDC range
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 9 Jan 2020 00:05:23 +0000 (01:05 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 27 Jan 2020 18:49:51 +0000 (10:49 -0800)
The firmware has to reside in the PDC range. If the Elf file
expects to load it below FIRMWARE_START, it is incorrect,
regardless the RAM size.

Acked-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200109000525.24744-2-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
hw/hppa/machine.c

index a35527cfc7aec776925f9f7fa8f06f2a1da21d50..e57530950a4719c2215df9e2ba56b1de44d8c1d0 100644 (file)
@@ -171,7 +171,7 @@ static void machine_hppa_init(MachineState *machine)
     qemu_log_mask(CPU_LOG_PAGE, "Firmware loaded at 0x%08" PRIx64
                   "-0x%08" PRIx64 ", entry at 0x%08" PRIx64 ".\n",
                   firmware_low, firmware_high, firmware_entry);
-    if (firmware_low < ram_size || firmware_high >= FIRMWARE_END) {
+    if (firmware_low < FIRMWARE_START || firmware_high >= FIRMWARE_END) {
         error_report("Firmware overlaps with memory or IO space");
         exit(1);
     }