From patchwork Mon Aug 12 19:44:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 266631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (unknown [IPv6:2001:4830:134:3::12]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E34C52C0115 for ; Tue, 13 Aug 2013 05:45:03 +1000 (EST) Received: from localhost ([::1]:47482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8y33-0007CS-6Y for incoming@patchwork.ozlabs.org; Mon, 12 Aug 2013 15:45:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8y2h-0007CF-HD for qemu-devel@nongnu.org; Mon, 12 Aug 2013 15:44:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8y2c-0003nn-N0 for qemu-devel@nongnu.org; Mon, 12 Aug 2013 15:44:39 -0400 Received: from hall.aurel32.net ([2001:470:1f0b:4a8::1]:44600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8y2c-0003mY-FT for qemu-devel@nongnu.org; Mon, 12 Aug 2013 15:44:34 -0400 Received: from [2001:470:d4ed:0:ea11:32ff:fea1:831a] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1V8y2S-0005gB-Kh; Mon, 12 Aug 2013 21:44:24 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1V8y2R-0003Y1-3y; Mon, 12 Aug 2013 21:44:23 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Mon, 12 Aug 2013 21:44:20 +0200 Message-Id: <1376336660-11927-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f0b:4a8::1 Cc: Stefan Weil , Peter Jovanovic , Aurelien Jarno , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH for-1.6] mips_malta: do not raise exceptions when accessing invalid memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since commit c658b94f6e8c206c59d02aa6fbac285b86b53d2c, MIPS raises exceptions when accessing invalid memory. This is not the correct behaviour for MIPS Malta Core LV, as the GT-64120A system controller just ignore undecoded access. This feature is used by the Linux kernel to probe for some devices. Emulate the correct behaviour in QEMU by adding an empty slot covering the entire memory space decoded by the GT-64120A. Signed-off-by: Aurelien Jarno Tested-by: Stefan Weil --- default-configs/mips-softmmu.mak | 1 + default-configs/mips64-softmmu.mak | 1 + default-configs/mips64el-softmmu.mak | 1 + default-configs/mipsel-softmmu.mak | 1 + hw/mips/mips_malta.c | 6 ++++++ 5 files changed, 10 insertions(+) diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak index 926709a..71177ef 100644 --- a/default-configs/mips-softmmu.mak +++ b/default-configs/mips-softmmu.mak @@ -34,3 +34,4 @@ CONFIG_JAZZ_LED=y CONFIG_MC146818RTC=y CONFIG_VT82C686=y CONFIG_ISA_TESTDEV=y +CONFIG_EMPTY_SLOT=y diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak index 0ef3f09..617301b 100644 --- a/default-configs/mips64-softmmu.mak +++ b/default-configs/mips64-softmmu.mak @@ -34,3 +34,4 @@ CONFIG_JAZZ_LED=y CONFIG_MC146818RTC=y CONFIG_VT82C686=y CONFIG_ISA_TESTDEV=y +CONFIG_EMPTY_SLOT=y diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak index 6089318..317b151 100644 --- a/default-configs/mips64el-softmmu.mak +++ b/default-configs/mips64el-softmmu.mak @@ -36,3 +36,4 @@ CONFIG_JAZZ_LED=y CONFIG_MC146818RTC=y CONFIG_VT82C686=y CONFIG_ISA_TESTDEV=y +CONFIG_EMPTY_SLOT=y diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak index cd59e24..532a9ae 100644 --- a/default-configs/mipsel-softmmu.mak +++ b/default-configs/mipsel-softmmu.mak @@ -34,3 +34,4 @@ CONFIG_JAZZ_LED=y CONFIG_MC146818RTC=y CONFIG_VT82C686=y CONFIG_ISA_TESTDEV=y +CONFIG_EMPTY_SLOT=y diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 0f5de33..61cb3e4 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -50,6 +50,7 @@ #include "qemu/host-utils.h" #include "sysemu/qtest.h" #include "qemu/error-report.h" +#include "hw/empty_slot.h" //#define DEBUG_BOARD_INIT @@ -908,6 +909,11 @@ void mips_malta_init(QEMUMachineInitArgs *args) DeviceState *dev = qdev_create(NULL, TYPE_MIPS_MALTA); MaltaState *s = MIPS_MALTA(dev); + /* The whole address space decoded by the GT-64120A doesn't generate + exception when accessing invalid memory. Create an empty slot to + emulate this feature. */ + empty_slot_init(0, 0x1fffffff); + qdev_init_nofail(dev); /* Make sure the first 3 serial ports are associated with a device. */