From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZC7X-00066Y-1J for qemu-devel@nongnu.org; Mon, 16 Feb 2009 17:39:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZC7U-00065P-Bo for qemu-devel@nongnu.org; Mon, 16 Feb 2009 17:39:22 -0500 Received: from [199.232.76.173] (port=58925 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZC7U-00065J-1s for qemu-devel@nongnu.org; Mon, 16 Feb 2009 17:39:20 -0500 Received: from soufre.accelance.net ([213.162.48.15]:59972) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LZC7T-0004mi-F0 for qemu-devel@nongnu.org; Mon, 16 Feb 2009 17:39:19 -0500 Received: from [192.168.0.3] (potipota.net [88.168.176.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by soufre.accelance.net (Postfix) with ESMTP id 4302B45040 for ; Mon, 16 Feb 2009 23:39:16 +0100 (CET) From: Lionel Landwerlin Content-Type: text/plain Date: Mon, 16 Feb 2009 23:39:14 +0100 Message-Id: <1234823954.8648.3.camel@cocoduo.atr> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] 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 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 --- monitor.c | 35 +++++++++++++++++++++++++++++++++-- 1 files changed, 33 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 745c335..a9d378c 100644 --- a/monitor.c +++ b/monitor.c @@ -1245,6 +1245,35 @@ static void mem_info(void) } #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 @@ -1542,9 +1571,11 @@ static const term_cmd_t info_cmds[] = { "", "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, -- 1.5.6.5