From: Paul Burton Date: Fri, 14 Jun 2013 07:30:46 +0000 (+0100) Subject: mips_malta: cap BIOS endian swap length at 0x3e0000 bytes X-Git-Tag: qemu-xen-4.4.0-rc1~6^2~127^2~11 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1817f56a834f55311af20d1c004b259c16fb1515;p=qemu-upstream-4.4-testing.git mips_malta: cap BIOS endian swap length at 0x3e0000 bytes This preserves the final sector of the pflash which is used by YAMON to hold environment variables. If the endianness of the environment data is swapped then YAMON will fail to load environment variables from pflash. Signed-off-by: Paul Burton Signed-off-by: Leon Alrae Signed-off-by: Aurelien Jarno --- diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index e06e19d2d..a740f614f 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -978,7 +978,7 @@ void mips_malta_init(QEMUMachineInitArgs *args) if (!addr) { addr = memory_region_get_ram_ptr(bios); } - end = (void *)addr + bios_size; + end = (void *)addr + MIN(bios_size, 0x3e0000); while (addr < end) { bswap32s(addr); addr++;