From patchwork Tue Feb 9 22:14:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 8266001 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 900159F38B for ; Tue, 9 Feb 2016 22:17:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E159F20218 for ; Tue, 9 Feb 2016 22:17:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09F8C201F4 for ; Tue, 9 Feb 2016 22:17:34 +0000 (UTC) Received: from localhost ([::1]:32915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGbF-0003Vm-3t for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 17:17:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGb3-0003UZ-Mj for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTGaz-0000sA-E3 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:21 -0500 Received: from mail-bl2nam02on0068.outbound.protection.outlook.com ([104.47.38.68]:61147 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGaz-0000rl-7G for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:17 -0500 Received: from SN1NAM02FT038.eop-nam02.prod.protection.outlook.com (10.152.72.58) by SN1NAM02HT158.eop-nam02.prod.protection.outlook.com (10.152.72.170) with Microsoft SMTP Server (TLS) id 15.1.409.7; Tue, 9 Feb 2016 22:17:16 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by SN1NAM02FT038.mail.protection.outlook.com (10.152.72.69) with Microsoft SMTP Server (TLS) id 15.1.409.7 via Frontend Transport; Tue, 9 Feb 2016 22:17:15 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:35328 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aTGaw-0002mL-VH; Tue, 09 Feb 2016 14:17:14 -0800 Received: from [127.0.0.1] (port=42547 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aTGaw-0007Zp-Pm; Tue, 09 Feb 2016 14:17:14 -0800 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u19MBYSL011517; Tue, 9 Feb 2016 14:11:34 -0800 Received: from [172.19.74.182] (port=49712 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aTGav-0007Zm-WA; Tue, 09 Feb 2016 14:17:14 -0800 From: Alistair Francis To: , Date: Tue, 9 Feb 2016 14:14:39 -0800 Message-ID: <97917e065d84b45174271d618572ce862a3d80ae.1455055858.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22054.006 X-TM-AS-Result: No--10.371-7.0-31-10 X-imss-scan-details: No--10.371-7.0-31-10 X-TMASE-MatchedRID: 9DomuZeNnSY1vivz3L6ga0KcYi5Qw/RVWDdWpJMntKhOCtCDJNptxq4T oUk/aSm1TrmpAQzEOVjH5DPULyc4TrBAQLqGlKivksHaPaQQRsDvmgUySWGueBMu6ersnFy9Lyc 54RnMqiqnL1+EP4NV2TtCpM5lJp2qwdbU3akH5AzMuewaQUInJH0tCKdnhB589yM15V5aWpj6C0 ePs7A07V9vMTaVNFNz1U6aUt4ZoiNcpHaEGG+MDi7qBM3Q5fqE31EI3uuSgws= X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(77096005)(48376002)(86362001)(50226001)(2950100001)(50986999)(76176999)(85426001)(4326007)(47776003)(2906002)(64026002)(1096002)(33646002)(586003)(87936001)(36756003)(5003600100002)(1220700001)(92566002)(5008740100001)(5001770100001)(6806005)(5001960100002)(118296001)(189998001)(105606002)(229853001)(50466002)(19580405001)(5003940100001)(19580395003)(106466001)(11100500001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT158; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2923f507-89e1-4631-3b7a-08d3319ec480 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT158; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(8121501046)(5005006)(13024025)(13015025)(13023025)(13017025)(3002001)(10201501046); SRVR:SN1NAM02HT158; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT158; X-Forefront-PRVS: 08476BC6EF X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2016 22:17:15.7110 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT158 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.68 Cc: edgar.iglesias@xilinx.com, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, alex.bennee@linaro.org, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH v4 01/16] memory: Allow subregions to not be printed by 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a function called memory_region_add_subregion_no_print() that creates memory subregions that won't be printed when running the 'info mtree' command. Signed-off-by: Alistair Francis Reviewed-by: KONRAD Frederic --- include/exec/memory.h | 17 +++++++++++++++++ memory.c | 10 +++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index c92734a..25353df 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -186,6 +186,7 @@ struct MemoryRegion { bool skip_dump; bool enabled; bool warning_printed; /* For reservations */ + bool do_not_print; uint8_t vga_logging_count; MemoryRegion *alias; hwaddr alias_offset; @@ -954,6 +955,22 @@ void memory_region_del_eventfd(MemoryRegion *mr, void memory_region_add_subregion(MemoryRegion *mr, hwaddr offset, MemoryRegion *subregion); + +/** + * memory_region_add_subregion_no_print: Add a subregion to a container. + * + * The same functionality as memory_region_add_subregion except that any + * memory regions added by this function are not printed by 'info mtree'. + * + * @mr: the region to contain the new subregion; must be a container + * initialized with memory_region_init(). + * @offset: the offset relative to @mr where @subregion is added. + * @subregion: the subregion to be added. + */ +void memory_region_add_subregion_no_print(MemoryRegion *mr, + hwaddr offset, + MemoryRegion *subregion); + /** * memory_region_add_subregion_overlap: Add a subregion to a container * with overlap. diff --git a/memory.c b/memory.c index 09041ed..228a8a7 100644 --- a/memory.c +++ b/memory.c @@ -1829,6 +1829,14 @@ void memory_region_add_subregion(MemoryRegion *mr, memory_region_add_subregion_common(mr, offset, subregion); } +void memory_region_add_subregion_no_print(MemoryRegion *mr, + hwaddr offset, + MemoryRegion *subregion) +{ + memory_region_add_subregion(mr, offset, subregion); + subregion->do_not_print = true; +} + void memory_region_add_subregion_overlap(MemoryRegion *mr, hwaddr offset, MemoryRegion *subregion, @@ -2219,7 +2227,7 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f, const MemoryRegion *submr; unsigned int i; - if (!mr) { + if (!mr || mr->do_not_print) { return; }