[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-1.6] target-mips: do not raise exceptions when a
From: |
Hervé Poussineau |
Subject: |
[Qemu-devel] [PATCH for-1.6] target-mips: do not raise exceptions when accessing invalid memory |
Date: |
Sat, 27 Jul 2013 18:18:17 +0200 |
c658b94f6e8c206c59d02aa6fbac285b86b53d2c ("cpu: Turn cpu_unassigned_access()
into a CPUState hook") made MIPS raise exceptions when accessing
invalid memory for data, by unconditionally calling CPUState unassigned hook.
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 devices
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 CPU hook.
Signed-off-by: Hervé Poussineau <address@hidden>
---
Another solution would be to add a big dummy memory regions on all MIPS boards
to catch memory accesses and not raise an exception. However, this means that
each MIPS board will have its own unassigned memory handler, different from 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, hwaddr 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", addr);
}
}
#endif /* !CONFIG_USER_ONLY */
--
1.7.10.4
- [Qemu-devel] [PATCH for-1.6] target-mips: do not raise exceptions when accessing invalid memory,
Hervé Poussineau <=