From patchwork Sat Feb 4 14:57:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 139580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5262104799 for ; Sun, 5 Feb 2012 01:57:37 +1100 (EST) Received: from localhost ([::1]:45843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rth3W-0005Ph-TP for incoming@patchwork.ozlabs.org; Sat, 04 Feb 2012 09:57:34 -0500 Received: from eggs.gnu.org ([140.186.70.92]:58805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rth3S-0005Pa-1d for qemu-devel@nongnu.org; Sat, 04 Feb 2012 09:57:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rth3Q-0000qg-1M for qemu-devel@nongnu.org; Sat, 04 Feb 2012 09:57:30 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:46833) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rth3P-0000qS-Pa for qemu-devel@nongnu.org; Sat, 04 Feb 2012 09:57:28 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate02.web.de (Postfix) with ESMTP id D33301C0A0C70 for ; Sat, 4 Feb 2012 15:57:26 +0100 (CET) Received: from mchn199C.mchp.siemens.de ([95.157.56.37]) by smtp.web.de (mrweb002) with ESMTPA (Nemesis) id 0MhULy-1SGBiG0ceA-00MvSw; Sat, 04 Feb 2012 15:57:26 +0100 Message-ID: <4F2D4755.3050105@web.de> Date: Sat, 04 Feb 2012 15:57:25 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Blue Swirl , qemu-devel References: <4F2BCCBD.8050009@siemens.com> In-Reply-To: <4F2BCCBD.8050009@siemens.com> X-Enigmail-Version: 1.3.5 X-Provags-ID: V02:K0:4C7RW29Us1QbW9Nd9rIOyD4XUsYQCE8ZwogOVpx9lzq DMn9di5CHOJ5l33koHco5gX7nDrKUlQd48komjwFov1yoT6rjW 4n8GPIhSFGL7Ry0nZVt7cFPy3+mIcARETfZqDsWrgC29Bn6nye 2+etw6pCmP6TOQOnD9HHXakKBY6yV0SE50MdBwEyFpZY3y2Yxz YwgSbpQwBkn9iiCVod6kw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: Avi Kivity Subject: [Qemu-devel] [PATCH v2] memory-region: Report if region is read-only or write-only on info mtree X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka Helpful to understand guest configurations of things like the i440FX's PAM or the state of ROM devices. Signed-off-by: Jan Kiszka --- Changes in v2: - encode R and W separately - print ROMD memory region state as well memory.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/memory.c b/memory.c index 5e77d8a..3095391 100644 --- a/memory.c +++ b/memory.c @@ -1609,23 +1609,31 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f, ml->printed = false; QTAILQ_INSERT_TAIL(alias_print_queue, ml, queue); } - mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d): alias %s @%s " - TARGET_FMT_plx "-" TARGET_FMT_plx "\n", + mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx + " (prio %d, %c%c): alias %s @%s " TARGET_FMT_plx + "-" TARGET_FMT_plx "\n", base + mr->addr, base + mr->addr + (target_phys_addr_t)int128_get64(mr->size) - 1, mr->priority, + mr->readable ? 'R' : '-', + !mr->readonly && (!mr->rom_device || !mr->readable) ? 'W' + : '-', mr->name, mr->alias->name, mr->alias_offset, mr->alias_offset + (target_phys_addr_t)int128_get64(mr->size) - 1); } else { - mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d): %s\n", + mon_printf(f, + TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n", base + mr->addr, base + mr->addr + (target_phys_addr_t)int128_get64(mr->size) - 1, mr->priority, + mr->readable ? 'R' : '-', + !mr->readonly && (!mr->rom_device || !mr->readable) ? 'W' + : '-', mr->name); }