Received: from eggs.gnu.org ([2001:4830:134:3::10]:37986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnOVa-0000df-D8 for qemu-devel@nongnu.org; Fri, 14 Jun 2013 03:33:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnOVV-0006D4-JA for qemu-devel@nongnu.org; Fri, 14 Jun 2013 03:33:18 -0400 Received: from multi.imgtec.com ([194.200.65.239]:8170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnOVV-0005vc-C0 for qemu-devel@nongnu.org; Fri, 14 Jun 2013 03:33:13 -0400 From: Leon Alrae Date: Fri, 14 Jun 2013 08:30:46 +0100 Message-ID: <1371195048-19618-5-git-send-email-leon.alrae@imgtec.com> In-Reply-To: <1371195048-19618-1-git-send-email-leon.alrae@imgtec.com> References: <1371195048-19618-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 4/6] mips_malta: cap BIOS endian swap length at 0x3e0000 bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: yongbok.kim@imgtec.com, cristian.cuna@imgtec.com, leon.alrae@imgtec.com, paul.burton@imgtec.com, aurelien@aurel32.net From: Paul Burton 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 --- hw/mips/mips_malta.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 116a2f8..6d43e86 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -974,7 +974,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++; -- 1.7.5.4