From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J8InJ-0004Mr-Ve for qemu-devel@nongnu.org; Fri, 28 Dec 2007 12:14:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J8InJ-0004MU-7n for qemu-devel@nongnu.org; Fri, 28 Dec 2007 12:14:49 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J8InI-0004MO-QA for qemu-devel@nongnu.org; Fri, 28 Dec 2007 12:14:48 -0500 Received: from pop-knobcone.atl.sa.earthlink.net ([207.69.195.64]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J8InI-0004Hl-I5 for qemu-devel@nongnu.org; Fri, 28 Dec 2007 12:14:48 -0500 Received: from user-142h2k8.cable.mindspring.com ([72.40.138.136] helo=earthlink.net) by pop-knobcone.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1J8InD-0000b2-00 for qemu-devel@nongnu.org; Fri, 28 Dec 2007 12:14:43 -0500 Message-ID: <47752F04.1000508@earthlink.net> Date: Fri, 28 Dec 2007 12:14:44 -0500 From: Robert Reif MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030902060604030207010308" Subject: [Qemu-devel] [PATCH] sparc32: better unassigned memory debug message Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------030902060604030207010308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Pass the asi number in is_asi. This works because asi 0 is not a valid asi. Print out the type of access (read, write, exec). --------------030902060604030207010308 Content-Type: text/plain; name="op_helper.c.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="op_helper.c.diff.txt" diff -p -u -r1.61 op_helper.c --- target-sparc/op_helper.c 10 Dec 2007 19:58:20 -0000 1.61 +++ target-sparc/op_helper.c 28 Dec 2007 17:07:49 -0000 @@ -416,7 +416,7 @@ void helper_ld_asi(int asi, int size, in break; case 0x21 ... 0x2d: /* MMU passthrough, unassigned */ default: - do_unassigned_access(T0, 0, 0, 1); + do_unassigned_access(T0, 0, 0, asi); ret = 0; break; } @@ -717,7 +717,7 @@ void helper_st_asi(int asi, int size) case 9: /* Supervisor code access, XXX */ case 0x21 ... 0x2d: /* MMU passthrough, unassigned */ default: - do_unassigned_access(T0, 1, 0, 1); + do_unassigned_access(T0, 1, 0, asi); return; } } @@ -1832,6 +1832,17 @@ void do_unassigned_access(target_phys_ad generated code */ saved_env = env; env = cpu_single_env; +#ifdef DEBUG_UNASSIGNED + if (is_asi) + printf("Unassigned mem %s access to " TARGET_FMT_plx " asi 0x%02x from " + TARGET_FMT_lx "\n", + is_exec ? "exec" : is_write ? "write" : "read", addr, is_asi, + env->pc); + else + printf("Unassigned mem %s access to " TARGET_FMT_plx " from " + TARGET_FMT_lx "\n", + is_exec ? "exec" : is_write ? "write" : "read", addr, env->pc); +#endif if (env->mmuregs[3]) /* Fault status register */ env->mmuregs[3] = 1; /* overflow (not read before another fault) */ if (is_asi) @@ -1845,10 +1856,6 @@ void do_unassigned_access(target_phys_ad env->mmuregs[3] |= (5 << 2) | 2; env->mmuregs[4] = addr; /* Fault address register */ if ((env->mmuregs[0] & MMU_E) && !(env->mmuregs[0] & MMU_NF)) { -#ifdef DEBUG_UNASSIGNED - printf("Unassigned mem access to " TARGET_FMT_plx " from " TARGET_FMT_lx - "\n", addr, env->pc); -#endif if (is_exec) raise_exception(TT_CODE_ACCESS); else --------------030902060604030207010308--