From patchwork Mon Jun 27 02:27:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Chen X-Patchwork-Id: 9199807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF40F60754 for ; Mon, 27 Jun 2016 02:27:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE4CC2855B for ; Mon, 27 Jun 2016 02:27:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2EE228563; Mon, 27 Jun 2016 02:27:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1309E2855B for ; Mon, 27 Jun 2016 02:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbcF0C1h (ORCPT ); Sun, 26 Jun 2016 22:27:37 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:51179 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbcF0C1f convert rfc822-to-8bit (ORCPT ); Sun, 26 Jun 2016 22:27:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yJjre10NgtigU9JntzWaa8LYR9NCnVwtjshrgqTj9nI=; b=RhO7GkaxwQcN188gc35ZMtAV35WOUAPpCuNu18FeIluZwJKT2nhgTyaI4j4tVfbCC2eGW/3cQHQ/AoyuqptfOOR83+N8Vnomt+ZdcyrfTByfTx7FCNv+ifJo9ZIWb0XMHdKw3mue1hl0ZayM0/6cwQuPVlGo5I1eOcFkxtyfEYo= Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3lrp0081.outbound.protection.outlook.com [213.199.154.81]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-44-s0thTNA4MfqucR2p7eNsNQ-1; Mon, 27 Jun 2016 03:27:31 +0100 Received: from AM3PR08CA0074.eurprd08.prod.outlook.com (10.163.23.170) by DB5PR0801MB1526.eurprd08.prod.outlook.com (10.167.229.148) with Microsoft SMTP Server (TLS) id 15.1.523.12; Mon, 27 Jun 2016 02:27:24 +0000 Received: from DB3FFO11FD012.protection.gbl (2a01:111:f400:7e04::194) by AM3PR08CA0074.outlook.office365.com (2a01:111:e400:8854::42) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Mon, 27 Jun 2016 02:27:24 +0000 Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD012.mail.protection.outlook.com (10.47.216.168) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Mon, 27 Jun 2016 02:27:23 +0000 Received: from dennis-ws.asiapac.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Mon, 27 Jun 2016 03:27:21 +0100 From: Dennis Chen To: CC: , Dennis Chen , Catalin Marinas , Steve Capper , "Ard Biesheuvel" , Will Deacon , Mark Rutland , "Rafael J . Wysocki" , Matt Fleming , , , Subject: [PATCH v3 1/2] mm: memblock Add some new functions to address the mem limit issue Date: Mon, 27 Jun 2016 10:27:10 +0800 Message-ID: <1466994431-6214-1-git-send-email-dennis.chen@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(47776003)(50986999)(106466001)(86362001)(26826002)(586003)(2351001)(229853001)(36756003)(33646002)(5003940100001)(4326007)(19580405001)(19580395003)(8676002)(87936001)(2906002)(6806005)(8936002)(104016004)(77096005)(92566002)(11100500001)(356003)(246002)(48376002)(50466002)(5003600100003)(189998001)(7846002)(7696003)(110136002)(305945005)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0801MB1526; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD012; 1:5id7Y5Nr9NClvY8pZj0nn1klSEBOq3b+6khbK+CYvCsCSMgnLZUWHVADmKjs6IHKltdVM47k8gUKVdUl0EayswZfLEjy9B7iavhcw3DjfQO2VInn/lDQNc3sHb+GuXExH/7FTE63tzFlvKYa00MvT8RyCjjIMPdvQ2Hlz3uP75yAvz1sdR52sIR4o9vHLaFs5NBKap1pcv7fG8eyvbOQM/1Zqa9uM49e+8YjviSJCKwOaMghHIuAFVpo9BxYgt6C22mTeRyAPU8KdJUw6LQrdx4sreyBOeAQUb8iW1jX+IwTwUngxUthIClsPYkACxHRYSmLhOiFNjF6fNYFZOT7gZq6Dv4jYcRp+ECLGIAUYEvlNHMAI5gjMxg5XfikXW9Bs6FSd5LnqiqkPXas2zx6veV2CMtrVudGrmch8HyYpKbBScHMNWj6xBGLTpzE4BTPv5E9U87fy/l4XiP2pq1ujeaqSeY3eEh13OWQ4/xlE8vkQgMeNQMCrRQzp22TfN2R+KnMw8nFYnWiKCGxADeq2k05YuGg40LlD8nYOvqSlOFweEnsdazYPzFotvDYLHq+VQnBB7okfKD8zghUkYTS7sucjk90jaJp4094ctkbmYjSJyyimg1ZFzNIP+p3crpiUKtkw7NlxAyCsfsNGmAW1g== X-MS-Office365-Filtering-Correlation-Id: 2acdd56b-b3cf-47aa-9366-08d39e329306 X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1526; 2:4Sp3mDQZf6BQBfZqnQUuzriA0s3zVzWfInizn4yeSUMlSYY/L3fsB2io+dXDLoGkyJDb17Pux0HvE8L5YIwcdaEYe8IXqXIYC8ZseDbQQVMCSAhf45peHiHpqPpfN/oO3gAnN/pqQK0vVs2BFbrl1efX1Wmp3uYWcICQl0VJ0e/c5dTql0Qplc0HNs1IR14p; 3:jReD9rpwMDyzQMXGke+NMdOUjN/KdnwOFn8mIyN0eZMZau36SrzPdIkt5x9m1x1ZzlQt7xM3m98ixWmCAWB15/U6v1VJ09/p6CPXHjqLu5iIXDCqyq+JNUrifL+EnPzRjX199q4ViKfsEC7acQJWAb4u6fsdWG30Fcg5q/w+7wFdcXEUinMGmm0Lt0lq5gI7CfiGGTLMC2i7sYsdXO2NhWYFKkhhheN2rcczpurgLg5N86OIdWndFu+G+MSqZZ/mToh1WU5hEsMgYtnwxaGToQ==; 25:MnKJJQ4uFm7M01Y4Ybi7oPLVb3j5eOV2LV9fZA1nYb2TQA6ZElF+5p34qRFAgspyr/iKffMWrz3htE17A3axwLxuLDPMPwgbin4PcsEiGWcsIVweapawI1PrNokmo1htSdluwPp72Q6RfTQn3sDG21U1ieFGhYVOJ0U/iuNxLsKOAJz9ni6DeeZSMw4ej2Ls83kDtss+i2CyEbwUh072ohl3qayPsjXA0lTVLS4PJaWrrEI7yMF3dbosT0WvR0aOKOS12pMnQXqLj0MRGZ60vbnFpGHDFOgQuMnqxjK928TVR6iTAavMBH1kIlDSjsdFlXqWIJpQCAYNLBx3H4Scfjf26wSOJfRG7+b/D5jpR0M3E020nd2pSOlF5CbjPtwzO8nHLMe6FBVc7IL090AVE0hHpPiq5ya6BDHz0egXY7c= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB5PR0801MB1526; NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1526; 20:2NHuKTdO3jPzDnx6tZwO9xb2l0BNI1A+u7GnZydlG7wwCx5qQ/2qAka+kpQ0gs5LO/isfKe/BXIYYPIcAjpEbJ78XrPfkUslnScC7wect95mG19KS63JJl+S0AT2AXDFec0Kq3PXl7Y+99Hncu9CkIF1YE4Ks9OWQdynWU3/+AI2nxWdx8Ok3vTpzksId39P3E+Vz1Z2NSdao+dEVOu76pQ5mj3ZScQqoRTocU4u6S7d4fIPFWKsr7/NUurWgQdz; 4:mlTOpPqxTcG13lPtjTBHqRUZNBz6+OA0LUOJQq/MVHyJPNnrTuDMUYAsJavhpxouuJHptfoWCIWFvt3HygqM+bTxH706O+Nx6ShjHwIOg2J1Jg9lwdmwvKxBMqA05kLrVQz89blAIAKpbEIYej9N4lp8jadRCKJj4xcIsrrmL8WLmsjc/pUoQ4yomgKx26sSXLZ6NjvVMaJGQzvKsbGIj4vwhP/GbvuBUA9Pk0UDnRIBKNoz+BDF5pmQ1U7/SLC+Hl2/gthJ9An/7uQQM0kHl9I703EhYoE84tKSdtC/MPa827k1pvA1yGwdwv1OchIFyybvsJy+n1F4XHjQIw6a3Kfob9aOD9hKCIlNQBTXeI0UwVSKpT4NGvTOh5Ya/PJkfM1AULZL8ZtKPRELiQf2IjyJjR9hW1/L/D/CSKPPU8ZBMNY6XK659tswCVcoVBbUP+QipRvE6wLBLTctmk4tOpqWlN6WxKGOowmawbi4R1I/xzsW6ZxbEmJkmR6kFOWCt4YwzSBaNv8Ese4aZzq/lVd7m17r9hPVDP9/1x6xXdHw8l/iuRKNyuBS2KGxClvd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(9452136761055)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13020025)(13024025)(13013025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:DB5PR0801MB1526; BCL:0; PCL:0; RULEID:; SRVR:DB5PR0801MB1526; X-Forefront-PRVS: 09860C2161 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR0801MB1526; 23:uc2Kl5l4Z4GjHoTeA0ZHddcKGARNf2YMnZ9vGYb?= =?us-ascii?Q?cnkCcyiO9JQ6NEOxVQGNgqmUXlcpi96KhPWE1a3WYGO8nK/qCU4B+qRjtNgr?= =?us-ascii?Q?jO9fHqGzdk2XrFBPJjUzTcVVsiSJSyr2oSL090cV+BIxO0jDNIMrUImswFu6?= =?us-ascii?Q?xQmTme6B1nuoUdXU9gSQUNMdYWotrUc60U+5ZU0WMbFmAmiif0LrKZ1DkqrO?= =?us-ascii?Q?Dn0/EBZ8BbHrtkl+9tmzhVQdxs4w5Yo2XfaVGVJBJJbJSgvcAeDeKdF8JKJA?= =?us-ascii?Q?E0olUSwXYDPpWQGXkgJ4P7UbWFvvPK5y7yGBsCZtZ4iobTUEF8/XlKVYc4Ic?= =?us-ascii?Q?7rcnRhT8LelmCgh3hR7MKt6gVIictdpztKvj7ngOw9lR2SfvzwZt2IrWBpZl?= =?us-ascii?Q?D1TO12gLIoQrrXV6lOOZN65NJm5iWTI16hDzbH0hlZlvB02pNzWU9Vcw99sk?= =?us-ascii?Q?7eZQVZSEJ7SF/l3wsS9N93jlR1NiO7ZCxlqph9HAxm5Zu2a4HZ64MjbP6LAU?= =?us-ascii?Q?0AaGaBKXiRcTp37K6l3jy3HXbFuiVS3fU0qybpV1AsHFiKIxKe844jZGv40f?= =?us-ascii?Q?QCysfmu4TKivcW7WxZ3Pw9XTbdNqqQy0pJjsal4oNtyCqbCIha2d/sUgQ1h6?= =?us-ascii?Q?r18SuLsE3yVNnxUJBEifdzQxgBVo78ucElrfETsJrXNWn2PSk+9vZPueoE+8?= =?us-ascii?Q?NjdMjlddm4QvyWfV7Dq9tc+GotnoPoCSuWo/2o9/9ZG64pwlvQsO6E5wgZsT?= =?us-ascii?Q?uexgVZmudTrMRmMTJxOcwCFCDoMXGti4C21nI0pbVSQR0ouJqW0VT/053RBP?= =?us-ascii?Q?DkSDqU/Dnr9lFVApBnNA3q0AWBg/TD6gERkV58ykB+Z3winGOiiTG5ZJikZR?= =?us-ascii?Q?6ypvyKU++Il5wsSyjfhM2jEx0GJWCfjCrkBDC2PYiFsOfYdab4Gaf/hwUukK?= =?us-ascii?Q?likQvGvbAiNm5s8yGJ46LUPIndF2p5mgW8ZS1ppWSJtqgUzZth9jI1LUZwBk?= =?us-ascii?Q?OxAGv1yLisSjvmIaEc5UxxWX8?= X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1526; 6:KzD4E3lYt2pFcMek6FCHMztotqDCXHfJ0yRm9t2ZWW1/eytM+HYOMwjlrjt7W7n5HeU7O5+CjkMJNxCzPdL1qMUOugaGCCMsYH4J/w18R++q1qx4eHxQVhZ/wRC0l8ApRmmm6wlm+KyY45n/m1viOkVlQ5bFO5NO3oUnoODUjgsZpp7Cx4pGY2LKzMdH6WiZnI0XIfPm/yPBpjY0DQjcF/qDp2KOceHJbrHF7LdcEBiPIgP+GnNoBRkJcCv/IwUR4s/InXUnaLKqIlOfUC+gjvc6EN+tTt8mw4AcS0Gjw0iVeIH7j1esciLI5lt3xdE3tDin+2CvbkR0ua1wmsGZNQCw5mX82XvBE0fzE/pUOvw=; 5:T4uu96KX+sTIIpyK9TW+JCSkp48xe5RoeXqmEbWgtiNryxiiClKomf8T2ywc0+3BjpkMKQg+DWNtMD6+QtywUbCGH4DXEFyLvwISLCkz+uETfL4RUUqVvWPEzyRNrYFlucxVKfUbosYeIDvLcKkwgg==; 24:62IyMJ2yDEz3Dm3ooWHtObI0YEiCCrfJ8OWAd62X/r76sWFgPJAW0xI+teA6Tzisd0Byzqw9T/TxztsFnvHzAgwWl7bgfzlQi03m0dLvr9o=; 7:Q/QSVXDCBAv98/iYfifrCo/l37O3eEOiXbbL1is98dGnYQ7GAvg9AcxftHuAysJnj7Inl/v8Xl6tlOSQN/037aRqrc1WF3BkWgq/7Y3l5jplJ1bQV5PtBoNzS8fVl3CuZn8fto1FOd/mWl9kbOkSMlqXvxvap7220XXV3oDXRsUiAsTo5TZS2SQgc9+OFi4W2IwNKSe1JtsfA8SXnC1oRC3AJo68JkR0MmIOUQJXc+Y6HQnqpzejZeVQmfCBOALQQR8P8A92bumOAOfyzRbelw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1526; 20:1x8afjPOatg/N9zsS/yyzJZot6HRcu5MHEmEFJ9qef3HPJohMJ/2ZgsKoqL1pYIstqTg43QV8y1SM6nMlBrM2W/r/Ab3/JYp6Bl/uSKPmnWPFe7oJ/VyQUWgVQudwLgU71bStUYcSI33W8Cmg6uqBiTX8n4qV7RAB0331eXIsy8= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2016 02:27:23.8954 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0801MB1526 X-MC-Unique: s0thTNA4MfqucR2p7eNsNQ-1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In some cases, memblock is queried to determine whether a physical address corresponds to memory present in a system even if unused by the OS for the linear mapping, highmem, etc. For example, the ACPI core needs this information to determine which attributes to use when mapping ACPI regions. Use of incorrect memory types can result in faults, data corruption, or other issues. Removing memory with memblock_enforce_memory_limit throws away this information, and so a kernel booted with 'mem=' may suffers from the issues described above. To avoid this, we need to keep those NOMAP regions instead of removing all above limit, which preserves the information we need while preventing other use of the regions. This patch adds new insfrastructure to retain all NOMAP memblock regions while removing others, to cater for this. At last, we add 'size' and 'flag' debug output in the memblock debugfs for ease of the memblock debug. The '/sys/kernel/debug/memblock/memory' output looks like before: 0: 0x0000008000000000..0x0000008001e7ffff 1: 0x0000008001e80000..0x00000083ff184fff 2: 0x00000083ff185000..0x00000083ff1c2fff 3: 0x00000083ff1c3000..0x00000083ff222fff 4: 0x00000083ff223000..0x00000083ffe42fff 5: 0x00000083ffe43000..0x00000083ffffffff After applied: 0: 0x0000008000000000..0x0000008001e7ffff 0x0000000001e80000 0x4 1: 0x0000008001e80000..0x00000083ff184fff 0x00000003fd305000 0x0 2: 0x00000083ff185000..0x00000083ff1c2fff 0x000000000003e000 0x4 3: 0x00000083ff1c3000..0x00000083ff222fff 0x0000000000060000 0x0 4: 0x00000083ff223000..0x00000083ffe42fff 0x0000000000c20000 0x4 5: 0x00000083ffe43000..0x00000083ffffffff 0x00000000001bd000 0x0 Signed-off-by: Dennis Chen Cc: Catalin Marinas Cc: Steve Capper Cc: Ard Biesheuvel Cc: Will Deacon Cc: Mark Rutland Cc: Rafael J. Wysocki Cc: Matt Fleming Cc: linux-mm@kvack.org Cc: linux-acpi@vger.kernel.org Cc: linux-efi@vger.kernel.org --- include/linux/memblock.h | 1 + mm/memblock.c | 55 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 6c14b61..2925da2 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -332,6 +332,7 @@ phys_addr_t memblock_mem_size(unsigned long limit_pfn); phys_addr_t memblock_start_of_DRAM(void); phys_addr_t memblock_end_of_DRAM(void); void memblock_enforce_memory_limit(phys_addr_t memory_limit); +void memblock_mem_limit_remove_map(phys_addr_t limit); bool memblock_is_memory(phys_addr_t addr); int memblock_is_map_memory(phys_addr_t addr); int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); diff --git a/mm/memblock.c b/mm/memblock.c index ca09915..8099f1a 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1465,14 +1465,11 @@ phys_addr_t __init_memblock memblock_end_of_DRAM(void) return (memblock.memory.regions[idx].base + memblock.memory.regions[idx].size); } -void __init memblock_enforce_memory_limit(phys_addr_t limit) +static phys_addr_t __init_memblock __find_max_addr(phys_addr_t limit) { phys_addr_t max_addr = (phys_addr_t)ULLONG_MAX; struct memblock_region *r; - if (!limit) - return; - /* find out max address */ for_each_memblock(memory, r) { if (limit <= r->size) { @@ -1482,6 +1479,20 @@ void __init memblock_enforce_memory_limit(phys_addr_t limit) limit -= r->size; } + return max_addr; +} + +void __init memblock_enforce_memory_limit(phys_addr_t limit) +{ + phys_addr_t max_addr; + + if (!limit) + return; + + max_addr = __find_max_addr(limit); + if (max_addr == (phys_addr_t)ULLONG_MAX) + return; + /* truncate both memory and reserved regions */ memblock_remove_range(&memblock.memory, max_addr, (phys_addr_t)ULLONG_MAX); @@ -1489,6 +1500,32 @@ void __init memblock_enforce_memory_limit(phys_addr_t limit) (phys_addr_t)ULLONG_MAX); } +void __init memblock_mem_limit_remove_map(phys_addr_t limit) +{ + struct memblock_type *type = &memblock.memory; + phys_addr_t max_addr; + int i, ret, start_rgn, end_rgn; + + if (!limit) + return; + + max_addr = __find_max_addr(limit); + if (max_addr == (phys_addr_t)ULLONG_MAX) + return; + + ret = memblock_isolate_range(type, max_addr, (phys_addr_t)ULLONG_MAX, + &start_rgn, &end_rgn); + if (ret) { + WARN_ONCE(1, "Mem limit failed, will not be applied!\n"); + return; + } + + for (i = end_rgn - 1; i >= start_rgn; i--) { + if (!memblock_is_nomap(&type->regions[i])) + memblock_remove_region(type, i); + } +} + static int __init_memblock memblock_search(struct memblock_type *type, phys_addr_t addr) { unsigned int left = 0, right = type->cnt; @@ -1677,13 +1714,15 @@ static int memblock_debug_show(struct seq_file *m, void *private) reg = &type->regions[i]; seq_printf(m, "%4d: ", i); if (sizeof(phys_addr_t) == 4) - seq_printf(m, "0x%08lx..0x%08lx\n", + seq_printf(m, "0x%08lx..0x%08lx 0x%08lx 0x%lx\n", (unsigned long)reg->base, - (unsigned long)(reg->base + reg->size - 1)); + (unsigned long)(reg->base + reg->size - 1), + (unsigned long)reg->size, reg->flags); else - seq_printf(m, "0x%016llx..0x%016llx\n", + seq_printf(m, "0x%016llx..0x%016llx 0x%016llx 0x%lx\n", (unsigned long long)reg->base, - (unsigned long long)(reg->base + reg->size - 1)); + (unsigned long long)(reg->base + reg->size - 1), + (unsigned long long)reg->size, reg->flags); } return 0;