Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeNrd-0001f1-Dx for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:12:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeNrc-0001eX-Md for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:12:24 -0500 Received: from [199.232.76.173] (port=39196 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeNrc-0001eS-8e for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:12:24 -0500 Received: from savannah.gnu.org ([199.232.41.3]:46773 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LeNrc-0004zs-1M for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:12:24 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LeNrb-0004rF-Et for qemu-devel@nongnu.org; Tue, 03 Mar 2009 06:12:23 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LeNrb-0004qU-4V for qemu-devel@nongnu.org; Tue, 03 Mar 2009 06:12:23 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Tue, 03 Mar 2009 06:12:23 +0000 Subject: [Qemu-devel] [6670] SH4: Added monitoring of TLBs 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 Revision: 6670 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6670 Author: aurel32 Date: 2009-03-03 06:12:22 +0000 (Tue, 03 Mar 2009) Log Message: ----------- SH4: Added monitoring of TLBs This patch might interest some people trying (as I try to do) to fix some tlbs for kernel/user space data sharing. Signed-off-by: Lionel Landwerlin Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/monitor.c Modified: trunk/monitor.c =================================================================== --- trunk/monitor.c 2009-03-03 06:12:14 UTC (rev 6669) +++ trunk/monitor.c 2009-03-03 06:12:22 UTC (rev 6670) @@ -1245,6 +1245,35 @@ } #endif +#if defined(TARGET_SH4) + +static void print_tlb(int idx, tlb_t *tlb) +{ + term_printf(" tlb%i:\t" + "asid=%hhu vpn=%x\tppn=%x\tsz=%hhu size=%u\t" + "v=%hhu shared=%hhu cached=%hhu prot=%hhu " + "dirty=%hhu writethrough=%hhu\n", + idx, + tlb->asid, tlb->vpn, tlb->ppn, tlb->sz, tlb->size, + tlb->v, tlb->sh, tlb->c, tlb->pr, + tlb->d, tlb->wt); +} + +static void tlb_info(void) +{ + CPUState *env = mon_get_cpu(); + int i; + + term_printf ("ITLB:\n"); + for (i = 0 ; i < ITLB_SIZE ; i++) + print_tlb (i, &env->itlb[i]); + term_printf ("UTLB:\n"); + for (i = 0 ; i < UTLB_SIZE ; i++) + print_tlb (i, &env->utlb[i]); +} + +#endif + static void do_info_kqemu(void) { #ifdef USE_KQEMU @@ -1556,9 +1585,11 @@ "", "show i8259 (PIC) state", }, { "pci", "", pci_info, "", "show PCI info", }, -#if defined(TARGET_I386) +#if defined(TARGET_I386) || defined(TARGET_SH4) { "tlb", "", tlb_info, "", "show virtual to physical memory mappings", }, +#endif +#if defined(TARGET_I386) { "mem", "", mem_info, "", "show the active virtual memory mappings", }, { "hpet", "", do_info_hpet,