From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V37B4-0001Vc-Lg for qemu-devel@nongnu.org; Sat, 27 Jul 2013 12:17:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V37Ay-0006Kv-Up for qemu-devel@nongnu.org; Sat, 27 Jul 2013 12:17:06 -0400 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:42973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V37Ay-0006KG-DG for qemu-devel@nongnu.org; Sat, 27 Jul 2013 12:17:00 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 27 Jul 2013 18:18:17 +0200 Message-Id: <1374941897-11956-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-1.6] target-mips: do not raise exceptions when accessing invalid memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Andreas=20F=C3=A4rber?= c658b94f6e8c206c59d02aa6fbac285b86b53d2c ("cpu: Turn cpu_unassigned_acces= s() into a CPUState hook") made MIPS raise exceptions when accessing invalid memory for data, by unconditionally calling CPUState unassigned h= ook. While this seems to be the right behaviour, this breaks a lot of guests (Linux on Malta, NetBSD on Magnum...) which try to access not emulated de= vices and crash because they don't handle the data load/store exception. Revert to previous behaviour by not handling the !is_exec case in MIPS CP= U hook. Signed-off-by: Herv=C3=A9 Poussineau --- Another solution would be to add a big dummy memory regions on all MIPS b= oards to catch memory accesses and not raise an exception. However, this means = that each MIPS board will have its own unassigned memory handler, different fr= om the global QEMU one. --- target-mips/op_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 5cf1c3f..94f1692 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -2156,7 +2156,8 @@ void mips_cpu_unassigned_access(CPUState *cs, hwadd= r addr, if (is_exec) { helper_raise_exception(env, EXCP_IBE); } else { - helper_raise_exception(env, EXCP_DBE); + qemu_log_mask(LOG_UNIMP, "should raise DBE exception " + "due to accessing memory at %" HWADDR_PRIx "\n", a= ddr); } } #endif /* !CONFIG_USER_ONLY */ --=20 1.7.10.4