]> git.proxmox.com Git - qemu.git/commitdiff
exec: fix breakpoint_invalidate when pc may not be translated
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 27 Sep 2013 18:29:17 +0000 (22:29 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 8 Nov 2013 05:25:22 +0000 (09:25 +0400)
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 <jcmvbkbc@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c

diff --git a/exec.c b/exec.c
index 79610ce37a67b5b1b4dda30790c526a37c87dc00..6492b0c24c2de879748ee4fb1e611ba2d7c17a8d 100644 (file)
--- 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 */