]> git.proxmox.com Git - qemu.git/commitdiff
PPC: Fix GDB read on code area for PPC6xx
authorFabien Chouteau <chouteau@adacore.com>
Tue, 18 Jun 2013 14:53:01 +0000 (16:53 +0200)
committerAlexander Graf <agraf@suse.de>
Sun, 30 Jun 2013 23:11:17 +0000 (01:11 +0200)
On PPC 6xx, data and code have separated TLBs. Until now QEMU was only
looking at data TLBs, which is not good when GDB wants to read code.

This patch adds a second call to get_physical_address() with an
ACCESS_CODE type of access when the first call with ACCESS_INT fails.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/mmu_helper.c

index 34330dc7d698a1436cf03d90b8581f78f80c4ecf..385b67ab23f85f278d1edb7a28d46dadafa9dc2d 100644 (file)
@@ -1431,7 +1431,15 @@ hwaddr cpu_get_phys_page_debug(CPUPPCState *env, target_ulong addr)
     }
 
     if (unlikely(get_physical_address(env, &ctx, addr, 0, ACCESS_INT) != 0)) {
-        return -1;
+
+        /* Some MMUs have separate TLBs for code and data. If we only try an
+         * ACCESS_INT, we may not be able to read instructions mapped by code
+         * TLBs, so we also try a ACCESS_CODE.
+         */
+        if (unlikely(get_physical_address(env, &ctx, addr, 0,
+                                          ACCESS_CODE) != 0)) {
+            return -1;
+        }
     }
 
     return ctx.raddr & TARGET_PAGE_MASK;