From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RthUt-0002K6-2k for qemu-devel@nongnu.org; Sat, 04 Feb 2012 10:25:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RthUn-0005oW-Dc for qemu-devel@nongnu.org; Sat, 04 Feb 2012 10:25:51 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:45870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RthUn-0005oR-1D for qemu-devel@nongnu.org; Sat, 04 Feb 2012 10:25:45 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate02.web.de (Postfix) with ESMTP id 24B051C0A0C38 for ; Sat, 4 Feb 2012 16:25:44 +0100 (CET) Message-ID: <4F2D4DF6.4090502@web.de> Date: Sat, 04 Feb 2012 16:25:42 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F2BCCBD.8050009@siemens.com> <4F2D4755.3050105@web.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v3] memory-region: Report if region is read-only or write-only on info mtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel , Avi Kivity 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 v3: - refactored writable condition (which DO makes sense as a ROM device is either in ROM or in write mode. It's readable and writable in both modes, but only in special ways. So let's tag it abstractly.) memory.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/memory.c b/memory.c index 5e77d8a..22816e2 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); } -- 1.7.3.4