From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLw2q-0004MK-Ix for qemu-devel@nongnu.org; Mon, 16 May 2011 07:33:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLw2p-00013n-Jv for qemu-devel@nongnu.org; Mon, 16 May 2011 07:33:04 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:54715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLw2p-00013i-Dc for qemu-devel@nongnu.org; Mon, 16 May 2011 07:33:03 -0400 Received: by bwz16 with SMTP id 16so4023433bwz.4 for ; Mon, 16 May 2011 04:33:02 -0700 (PDT) MIME-Version: 1.0 Sender: ben.leslie@gmail.com Date: Mon, 16 May 2011 21:33:02 +1000 Message-ID: From: Ben Leslie Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] [PATCH] Abort on attempts to load out-of-range ROMs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Abort on attempts to load out-of-range ROMs Change ROM loading behaviour so that attempts to load ROMs that fall outside valid memory ranges causing an abort with a useful error message, rather than silently ignoring the problem. Signed-off-by: Ben Leslie --- exec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/exec.c b/exec.c index a718d74..af1b6a2 100644 --- a/exec.c +++ b/exec.c @@ -3838,7 +3838,7 @@ void cpu_physical_memory_write_rom(target_phys_addr_t addr, if ((pd & ~TARGET_PAGE_MASK) != IO_MEM_RAM && (pd & ~TARGET_PAGE_MASK) != IO_MEM_ROM && !(pd & IO_MEM_ROMD)) { - /* do nothing */ + cpu_abort(first_cpu, "Attempting to load malformed ROM at address: 0x%x\n", addr); } else { unsigned long addr1; addr1 = (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK);