From e8262a1b5b7cfbcbc80c46e4ce6ff7c517b7b2f6 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Fri, 27 Sep 2013 22:29:17 +0400 Subject: [PATCH 1/2] exec: fix breakpoint_invalidate when pc may not be translated This fixes qemu abort with the following message: include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed. which happens due to attempt to invalidate breakpoint by virtual address for which get_phys_page_debug couldn't find mapping. For more details see http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04582.html Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov Reviewed-by: Paolo Bonzini --- exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 79610ce37a..6492b0c24c 100644 --- a/exec.c +++ b/exec.c @@ -409,8 +409,10 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) #else static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) { - tb_invalidate_phys_addr(cpu_get_phys_page_debug(cpu, pc) | - (pc & ~TARGET_PAGE_MASK)); + hwaddr phys = cpu_get_phys_page_debug(cpu, pc); + if (phys != -1) { + tb_invalidate_phys_addr(phys | (pc & ~TARGET_PAGE_MASK)); + } } #endif #endif /* TARGET_HAS_ICE */ From ebbfd5a094ead6f28d45718f97b4837bd3e7f916 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sun, 20 Oct 2013 04:15:23 +0400 Subject: [PATCH 2/2] target-xtensa: add missing DEBUG section to dc233c config This fixes missing debug feature opcodes of dc233c core variant. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov --- target-xtensa/core-dc233c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target-xtensa/core-dc233c.c b/target-xtensa/core-dc233c.c index 11acbf3580..738d543e53 100644 --- a/target-xtensa/core-dc233c.c +++ b/target-xtensa/core-dc233c.c @@ -49,6 +49,7 @@ static const XtensaConfig dc233c = { EXCEPTIONS_SECTION, INTERRUPTS_SECTION, TLB_SECTION, + DEBUG_SECTION, .clock_freq_khz = 10000, };