From 1817f56a834f55311af20d1c004b259c16fb1515 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Fri, 14 Jun 2013 08:30:46 +0100 Subject: [PATCH] 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 --- hw/mips/mips_malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index e06e19d2df..a740f614f7 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++;