From patchwork Thu Jul 14 05:43:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Chen X-Patchwork-Id: 9229005 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 A491D607D0 for ; Thu, 14 Jul 2016 05:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94ECC27FA9 for ; Thu, 14 Jul 2016 05:45:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 887B027FE4; Thu, 14 Jul 2016 05:45:18 +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 9332627FA9 for ; Thu, 14 Jul 2016 05:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751305AbcGNFpQ (ORCPT ); Thu, 14 Jul 2016 01:45:16 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:39244 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbcGNFpP convert rfc822-to-8bit (ORCPT ); Thu, 14 Jul 2016 01:45:15 -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=AxoIGpNeOLBomPWs9reUh2e0lhO0iBKAkArDwpGhIQA=; b=hRwG1hnK6d5vtKvGac1mkEdC4SnfNRHAVc/Vbz9EzfW+NIasmEF9XymGG61hc7b5MrZ7/R73/R9AqvEtf1BlUYZro5YipDaMrPmYOiBi8Z6pc8xuk0Dq+meJQfZ2aAHONR85brG64SXVHictr19gv5UWKikOn2J2HkDrV+e36DY= Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp0177.outbound.protection.outlook.com [213.199.154.177]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-50-fGF-qA_uOLiasxFx2txufA-1; Thu, 14 Jul 2016 06:45:10 +0100 Received: from AM3PR08CA0012.eurprd08.prod.outlook.com (2a01:111:e400:8840::22) by AM3PR08MB0659.eurprd08.prod.outlook.com (2a01:111:e400:c409::13) with Microsoft SMTP Server (TLS) id 15.1.539.14; Thu, 14 Jul 2016 05:45:09 +0000 Received: from AM1FFO11FD040.protection.gbl (2a01:111:f400:7e00::123) by AM3PR08CA0012.outlook.office365.com (2a01:111:e400:8840::22) with Microsoft SMTP Server (TLS) id 15.1.534.14 via Frontend Transport; Thu, 14 Jul 2016 05:45:09 +0000 Received: from nebula.arm.com (217.140.96.140) by AM1FFO11FD040.mail.protection.outlook.com (10.174.64.229) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Thu, 14 Jul 2016 05:45:08 +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; Thu, 14 Jul 2016 06:44:56 +0100 From: Dennis Chen To: CC: , , , , , , , , , , , , , , , , , , Subject: [PATCH v6 1/2] mm:memblock Add new infrastructure to address the mem limit issue Date: Thu, 14 Jul 2016 13:43:55 +0800 Message-ID: <1468475036-5852-2-git-send-email-dennis.chen@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468475036-5852-1-git-send-email-dennis.chen@arm.com> References: <1468475036-5852-1-git-send-email-dennis.chen@arm.com> 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)(199003)(189002)(106466001)(26826002)(189998001)(5003940100001)(86362001)(76176999)(110136002)(104016004)(92566002)(87936001)(50986999)(575784001)(4326007)(19580395003)(7846002)(50226002)(586003)(11100500001)(305945005)(7696003)(8936002)(2906002)(33646002)(77096005)(2950100001)(47776003)(2351001)(50466002)(246002)(8676002)(48376002)(36756003)(356003)(19580405001)(229853001)(6806005)(5003600100003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR08MB0659; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD040; 1:SyNFC7Cjkvcvg3d8DD4qN8mJ7EJqKNjqiINvK0rkhDEKumIJAoezPJ62raZStZWb72/9jY25A56caFOI1ZU1AHhpjA7G8ppbsnibj52fmtkkFd1ia1MENErIve/RwhkfEPMrhacy74Jz1J47YdeY3UvpSPxmvw7pDKEwTiX4A/qEDUZ9QjF69sURc5ECoPcmhvXsO/5UKbzN/HQ8gRmuqrhO0NUTKevZZyJZ7Y8uyCJPHVWQUUJ/ZMmIfZyG/n4goraR4+8susqebfpIcXPSsrM3IEjc6UMjL8MFxSQKuW5dZan2a1aqt0y1RNOGu/tmUci96cFFUFJdWhhc+zX2X/TtJnhh1O3Ojz78jEopk99zK3B6dHb/YeNa6Hh4FpIkBYRrN4PRH7Jd1gSYTWTXgGdXyrc8zbMUazAqcrPIpfntK0YH++9UwtnATvHtDvzVC/K9l5jkKasyg7prw7aFockRXJHZTqBYjaNT+p9dmFkb1nmAxmdxfPECBY/pkel5eaWL+yEYF7tGhOq5pTe1S7lb2hb3CT8Vo6/tw4mArnrQWa8wOzy47aJjQziqOXrvotltj/UfMMuidxy9K05T3LJC4JKFLHGdW/S5Qvga3X0dnoVAUdTM4gCpSONFwqN1I9XEnZxUJel/exKwyYGzAQ== X-MS-Office365-Filtering-Correlation-Id: f2c2fa74-2ce5-411e-09ce-08d3abaa040b X-Microsoft-Exchange-Diagnostics: 1; AM3PR08MB0659; 2:CXHO382M9S/8KEqYm19mcF9s+qz2nCvZ3Mgyc8y+8MQU93z3tK/49QKp+GRJEWh0SutM76IFpumbRy9SO9Del/kx9cfG0Ug0XpX8SwO1G+hTwnQ6XCASKmFUeTXbA2a4t9z7em/8n6S6sBor3k2Jdn19H0lrr0zj/nxLexZn8oYowxfs6hiQW7kR/NiIrjKp; 3:nBNq6Lic1FpARa4s0IvrjUim6tjQ7U79bas1yc0LwUKZ2MAFhegVAncQRxojvbU6Z69L/h42OQHSPNckDbqYjcKVDnYRpl2A59Y1Vvpv1LusSo2cqwDYIdc1SKzMLfx2xm+n44oo7ajMkweUIo33xXuMPgDOMG+es7etnief+zG5fEuBECSIqyTvfhmPqs2OPhksj5kHA/rYZGmtzq34/pkLXB2kMvTMr2ZArvsD0piWJxit0VzLZFVosWNnAE1Lm5KB0IYke1JzgIHKG+fz5A==; 25:j+iyrMhGiGqyUmD80ltOzFLwW+OwpQZswZDFhhpHp0qNWLOlWg75CZE9F7QxvYCHuVLBl/pTXwNz5okHvd0pmAk3zBE0SHt/9IvPMi95HBaHpYDkyJWvPeYf6y+xLvYj5xBpo5ym7y6i5nYuni/XRT79VesLAQrhJ51iv7Btc5pwgfLq/JIQNA17Vbtfnl1JzA/CUqYQ9agS8dJfaa2kjm3ys5MMNiei6xWflfR8xKKWq8cYoXcElpgAJn0zFjXyhLBZVrWlSlcGd4hXcR/bDZWNYSNnGwuEcSHx0H3kDg6uSTK3VYWQuzldm6vi6kRJcIJt8aOylvcLyIvQxyPCMf0WqvyXbGu9Zet4Dksn29sbKEY2vd03XfeMoHXcxoOv675D6UHnZdM6ByNsS15MaEs7uGa5E9w5Sknq8by7sNc= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM3PR08MB0659; X-Microsoft-Exchange-Diagnostics: 1; AM3PR08MB0659; 31:wJELS3HMjFn0S9Oe8XcNRz4xa+hM7lDAnqAXQSSoUXvYiOYDpdxeGAUTgtg/JheuHcRqr4kIWWBd+tDNrbaYqRuqfzizmKOIULJID0VbaafRBPW+cfcoO8BJeezsWIT8I8fft5FWd+DQFy96WyemK6VO4jMQ64sHdnKNRXL6G38AmH99R0Gr8WyVEpavQIhENLq6U15RY8AXt0a8bvNYcQ==; 20:UL+2Cy2OxEz47hzTN7mbWTcpinaiuD5lKF8rIZkEnjLa8USrpjcfBq1Ezi48qYtTsoctkiKRf6moQGJXoOLpN5zN6pGgSH/uQ80ZS74UGh0xU8GN61e9pE0pD4cymyd9lnEnH9+6ELN1GLgsPqQI0sL5FuGC5vcMpvpEiPkZKeUm2/HDIsxkq5C4np/W+8bE5tdV2hvrZeyob9eshjxV4/EjgOfE7FD8RQNxpxQenO4rJmpkdbiWoxVDtLG6ETOC NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(9452136761055)(170618885588394)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(8121501046)(5005006)(13013025)(13024025)(13020025)(10201501046)(3002001)(6055026); SRVR:AM3PR08MB0659; BCL:0; PCL:0; RULEID:; SRVR:AM3PR08MB0659; X-Microsoft-Exchange-Diagnostics: 1; AM3PR08MB0659; 4:xj7TzKC98CQJ5/7ymBcI10TcY0d7Q+KC8hBRcz/eCqm3G5YdqH4a7VPu4MD/U4KxBqPfcDcfoOO3zgsvAGO1olF1Fwln33HACWVko5fv4wx+uXNHklAmV2IfxzG80HaRD/JPCzDVHbr54ZcgjAlr8+SYrimN3g2vlK+IfNap8Ua0SpyMPRbssPbLClDOxFhRGZhbjStVS0dCLpHXGIbnETUaRP0BwDoNZwSuZOi5oq0t0yuifHo2lSARd3hesPwGBa4uv4YP805xRxkcXGg8MCcUZXcY6YCdNA7SRidvvtPdiau1PYnTJ8mabx2LMbEKxHvSLF6Sitpj3SYCDLncOc7ed0R10XuFwZ4vM1GAsEfhtDMOP2G6DEa4bsNFHtwJXWfQD8DgfiQVeXQ/mVDV+Sknpii3oQ1he8AO3zG0JOVKe4vTFKnSlgMRDvN+FeBIAAKfYVeG3dGYUoha1G1dNTD2kt8fWy3UwyO6F+cS8sMLYNZ+x4Ql4A/mdl+/4FeJSks0F5VyRYKYY02EDFnXEasgIaALJLKQhrVeFmtLpF4k/jF6R8pXjyoG+hOYuTCtqCoeqm2iJEQTC0U6XTzpuMZRQsZoPn2TKOssrwhBxGo= X-Forefront-PRVS: 00032065B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR08MB0659; 23:L9r6TyarwA4ucD9PjBmHHWnH5ae7w02kIsbUzouLs?= =?us-ascii?Q?8nmy/XiWiBfSCmX9/RELVWzuJLbKb9lJ0+6vGyrShctSaztHer4Lb7NvWpQL?= =?us-ascii?Q?dJ2JLbQFc1A2t3dOszQW/7s/lxMnAiFPr2QDUXm0UXHsKrJWU2m9y8yD0eKV?= =?us-ascii?Q?5kKRDIP8w2mVKhG56uG5P8md7Lui+RgZnT4sRMjHKjUWS02S3tBOAC8JIdL1?= =?us-ascii?Q?iIb3WrMIh//T8r1Nco8wJGI5CMqOFJhz+KFaIlcbvaNjtYeusVnmfOdmV7+O?= =?us-ascii?Q?+cwadSsRKr3HJ8I2sd/sH5ybADOUBQJXy/xnZ919t6oacyD5kBC7q3nvVKms?= =?us-ascii?Q?OZW8P+I2NipQjbwWPlVmtW99qGtyAy9+lEGuFk+LCuTahdRzqS7JAKWGCZzt?= =?us-ascii?Q?UfNd28U7FMhg9eemw9r80U5DKB98sUoIpePSkda66CUOOTU1RufJ4azwS+7H?= =?us-ascii?Q?yOnkoOqKceJBFRQIH5LL2qReryH/sKxUBUWZnjtcGxfo8taCA9NBV4iVb6Hv?= =?us-ascii?Q?8p4CPRJguIeDd69sGHdNWWyoNdIgzaWsNQRDzg/RStA+vJ+U+7s7J3o2ghM1?= =?us-ascii?Q?n5zoap3qB1o0bBANnkQZxNJF4Y/NYyG3kP5iafRMtLDhowTz+xag62UmoxzA?= =?us-ascii?Q?ugMHIbVRryBWyIoElZuQSlfNKGtReQE5ZjQlMJeY8CTQf0Rk3p/wmv95t34r?= =?us-ascii?Q?uSxhZiScCoTx7e/X0gJjFStdsWc5NyO4aDu8nVxXbfwWS+Fj4ijkZnhvsJKd?= =?us-ascii?Q?M9kAHDN+daXGldeLl1ScJGXMM4qKEi6zl2gvKHLICvmb87QwuPRW9fanPCmH?= =?us-ascii?Q?3ehEl8YuDsKc01YEDbpRi4tNzdh/uvZ17AbT75ha6oR9m5iXdeJbxsBub/63?= =?us-ascii?Q?Fowv9zjcaDahXLJajgioYAR/ThaeyaZid/46TVgM2IkwEGUFauuS02kKcuax?= =?us-ascii?Q?kOI67ZMUPmE8cPaPRPiz4IY0Xfa5S+34enlpe15I9MLnYDBI6EW0HZ0UN4+l?= =?us-ascii?Q?v5d8t1271eV4YRl/71H4zMQi7cEGABmbouQpHJL+oYsZlP1TUhoBU5UD6LW4?= =?us-ascii?Q?QVThp2WkKBXim8tQNYtz83FFCPq8EBorbDNowryBpTos5YRnw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR08MB0659; 6:XRMjflb7/Z2CyGhjg2mHeLjd+nK9TEwdLmR4DVCk1e6EeHDgQCcwM+hRTh9ZfmqmCsGvZCIOZGAwlvV00luz7urGYF76ptBMRrQTH6zRL3K1RXoj6BZHHZNrESdwRur81vMrAaoPdaB6Z3LUtDQT3MFT3KLeLsjtG29g65iyww6/xb/bUp++aHIAjJmLpTN4eS97rSBomj2RORJp2PYP91gkNkaFCMRHgDEYKDISNMeXzMxz9mFqD58ooSljnx+AzH9JNkBlJoPPDl7GptRj7os00h3phHQ3FWIXVeQLJVnBOT8JorMqbHR0hMwQ+0jbePLhtbTKxHpkHoLCQTKWBg==; 5:PR1h52EcewN9yvBxaKm1+bmwHJYQl0eqOZCBjWhgEizJyU1tUwu+H/+bwN0o2YinUTKrsQ+oIxpSScexhgzQn1PgHjAl+J4K8sT7fn8ARJx+EMZ5tXJqWHlj2xzqHGgJ4kHndWMYSwxPM7SxlXvC5Q==; 24:BnUCWHdPPJ7+n4vr7ZU8lvjItRWCSApdB7ZDZwKNHk7OSKpJVt+tq+ZDdb4V0GcLReZniD1ME3yirDwbzXGc1XIEXudCqtF9acU6F4KjtOo=; 7:p6HNEh9f6ay+Djs8S73mWZcZkBnUhkSn6hDSf/xmdo7Qhlwn2R6qlq4+yYq84JTSH5S/mrj7EIqVpJGRsqHu0E4jmHKqStoU4+7kH+d4WnMMsgGuT+aipWlWl218m8mZm46+ssaUSww3Oi7T7HyOOdofHtX+D4nMWcoKmPHp1di35KODHkkAYl0R9vyRRvMz699NDJE8OafJf96TU0WTdGnWQFDTclOc8UvvkdqJxNnQk9g3oVR2hhXUzJ5Ecn4Y SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM3PR08MB0659; 20:KriF9sMpS/g9Gg2bQQ4b1nWB6uawMQ6F0LOLg9fY3Ow0cnBd10R0/Y8rohzArBt72qFqRtYqHWdbKyIfrjTYec39vTfSzanPrQGjI+VKralCSSE+5jneQZYeKyJ1oziyHmr7nKUvFRv+EykIaZ70EJrXa0toFSh0GSc6sudjavM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2016 05:45:08.7654 (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: AM3PR08MB0659 X-MC-Unique: fGF-qA_uOLiasxFx2txufA-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 by kernel to determine whether a specified address is RAM or not. For example, the ACPI core needs this information to determine which attributes to use when mapping ACPI regions(acpi_os_ioremap). 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 the limit, which preserves the information we need while preventing other use of those regions. This patch adds new infrastructure to retain all NOMAP memblock regions while removing others, to cater for this. Acked-by: Steve Capper Signed-off-by: Dennis Chen Cc: Catalin Marinas Cc: Ard Biesheuvel Cc: Andrew Morton Cc: Pekka Enberg Cc: Mel Gorman Cc: Tang Chen Cc: Tony Luck Cc: Ingo Molnar Cc: Rafael J. Wysocki Cc: Will Deacon Cc: Mark Rutland Cc: Matt Fleming Cc: Kaly Xin 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 | 57 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 5 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 0fc0fa1..02b68eb 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1465,15 +1465,16 @@ 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 */ + /* + * translate the memory @limit size into the max address within one of + * the memory memblock regions, if the @limit exceeds the total size + * of those regions, max_addr will keep original value ULLONG_MAX + */ for_each_memblock(memory, r) { if (limit <= r->size) { max_addr = r->base + limit; @@ -1482,6 +1483,22 @@ 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 = (phys_addr_t)ULLONG_MAX; + + if (!limit) + return; + + max_addr = __find_max_addr(limit); + + /* @limit exceeds the total size of the memory, do nothing */ + 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 +1506,36 @@ 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); + + /* @limit exceeds the total size of the memory, do nothing */ + 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) + return; + + /* remove all the MAP regions above the limit */ + for (i = end_rgn - 1; i >= start_rgn; i--) { + if (!memblock_is_nomap(&type->regions[i])) + memblock_remove_region(type, i); + } + /* truncate the reserved regions */ + memblock_remove_range(&memblock.reserved, max_addr, + (phys_addr_t)ULLONG_MAX); +} + static int __init_memblock memblock_search(struct memblock_type *type, phys_addr_t addr) { unsigned int left = 0, right = type->cnt;