From patchwork Wed Jan 9 20:20:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10754897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 758B013BF for ; Wed, 9 Jan 2019 20:21:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64C53292AC for ; Wed, 9 Jan 2019 20:21:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58F9729636; Wed, 9 Jan 2019 20:21:49 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF005292AC for ; Wed, 9 Jan 2019 20:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aksyZ/AZUuwMtCkOkdKKZ0wT2ih0ApaBkJnAba5+7o4=; b=noR+UD+yeZy35l uFbywe9lImnWrAkGwRT720+50HzyO3WcjfNFf1gNb2db53SuVL5yL4VK1LXvUW4Rd7pphQnnMAMJn QAEWfDMMffcwL+/AeuIufAE+4RrZ0HW1Wubol8k1kYjkRg8F94RXEdjoE4kho8FY+voF/bYMHNCBn bGUqHBxcycCe7uNZuOUt3oCT1aYPc04PWBSqkEEFWdnO292i1kGKwOKcGVy757lKL4Z27gD4CzU63 LWClhdUhtnRY7tInoZALVIVabTsrlVTF9XXvjSJj31uh8oBlsiwhroe8xYbgVgi7ODWziwjHBKv8d zs0zElNsMdbH3SOKzy5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghKMD-0003Pn-OE; Wed, 09 Jan 2019 20:21:45 +0000 Received: from ale.deltatee.com ([207.54.116.67]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghKLj-0002qM-WB for linux-arm-kernel@lists.infradead.org; Wed, 09 Jan 2019 20:21:19 +0000 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ghKLg-0005pG-2E; Wed, 09 Jan 2019 13:21:14 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1ghKLW-0001pA-NZ; Wed, 09 Jan 2019 13:21:02 -0700 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Wed, 9 Jan 2019 13:20:59 -0700 Message-Id: <20190109202100.6968-2-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20190109202100.6968-1-logang@deltatee.com> References: <20190109202100.6968-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, catalin.marinas@arm.com, linux@armlinux.org.uk, sbates@raithlin.com, logang@deltatee.com, keescook@chromium.org, philip@cog.systems, rostedt@goodmis.org, nicolas.pitre@linaro.org X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH 1/2] ARM: mm: make use of new memblocks_present() helper X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190109_122116_068684_822ACD93 X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Pitre , Kees Cook , Catalin Marinas , Will Deacon , Russell King , "Steven Rostedt \(VMware\)" , Stephen Bates , Philip Derrin , Logan Gunthorpe Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Cleanup the arm_memory_present() function seeing it's very similar to other arches. The new memblocks_present() helper checks for node ids which the arm version did not. However, this is equivalent seeing HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore memblock_get_region_node() should return 0. Signed-off-by: Logan Gunthorpe Cc: Russell King Cc: Kees Cook Cc: Philip Derrin Cc: "Steven Rostedt (VMware)" Cc: Nicolas Pitre --- arch/arm/mm/init.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 478ea8b7db87..6c50dd407ba8 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn) EXPORT_SYMBOL(pfn_valid); #endif -#ifndef CONFIG_SPARSEMEM -static void __init arm_memory_present(void) -{ -} -#else -static void __init arm_memory_present(void) -{ - struct memblock_region *reg; - - for_each_memblock(memory, reg) - memory_present(0, memblock_region_memory_base_pfn(reg), - memblock_region_memory_end_pfn(reg)); -} -#endif - static bool arm_memblock_steal_permitted = true; phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) @@ -292,7 +277,7 @@ void __init bootmem_init(void) * Sparsemem tries to allocate bootmem in memory_present(), * so must be done after the fixed reservations */ - arm_memory_present(); + memblocks_present(); /* * sparse_init() needs the bootmem allocator up and running. From patchwork Wed Jan 9 20:21:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10754893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D873191E for ; Wed, 9 Jan 2019 20:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4CE229609 for ; Wed, 9 Jan 2019 20:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8F7F2961F; Wed, 9 Jan 2019 20:21:23 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4700629618 for ; Wed, 9 Jan 2019 20:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F1ZmLPSG3GQhXqJk+Ma+4tuPzPaMMPjZgYaNTPnewyA=; b=tUWVWywzfTVkqX UnGk+nLSNej6kDxn+faHRM03DV6GTws8O+tMGG2unejs7JRVBr6q/P/aGYlWKGAETYw6CPkTtxMJF +sS3PUfW+mzPe0lP+EIC/lKnWZoYZZVjlMi6Lw+pcS8e9o2mqokzbzzKz17OdpqdeecNrO6OtermY IFPV8SwzJJWEOY7FFfli9P9Sf9k3k9mrK10UAh/Mk7QI4VgkKEBc4ZzdmMq+8nq0CRIq0fB8mp0IE 869L2qoKJvH7UHVREf2kQNmCwkjOTGnjcLxPhJ1BWpkpbkv9aAqt2oXOVrshAxm2XaBVPNdBjXGSy iYCE+z8UsjpPWQpnFm/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghKLn-0002rJ-2h; Wed, 09 Jan 2019 20:21:19 +0000 Received: from ale.deltatee.com ([207.54.116.67]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghKLj-0002pW-Hx for linux-arm-kernel@lists.infradead.org; Wed, 09 Jan 2019 20:21:18 +0000 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ghKLa-0005pH-Ei; Wed, 09 Jan 2019 13:21:08 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1ghKLW-0001pD-QC; Wed, 09 Jan 2019 13:21:02 -0700 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Wed, 9 Jan 2019 13:21:00 -0700 Message-Id: <20190109202100.6968-3-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20190109202100.6968-1-logang@deltatee.com> References: <20190109202100.6968-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, catalin.marinas@arm.com, linux@armlinux.org.uk, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH 2/2] arm64: mm: make use of new memblocks_present() helper X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190109_122115_639062_70C23C17 X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Logan Gunthorpe , Will Deacon , Russell King , Stephen Bates Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Cleanup the arm64_memory_present() function seeing it's very similar to other arches. memblocks_present() is a direct replacement of arm64_memory_present() Signed-off-by: Logan Gunthorpe Acked-by: Catalin Marinas Cc: Will Deacon Acked-by: Will Deacon --- arch/arm64/mm/init.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 7205a9085b4d..2302b4093a63 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -285,24 +285,6 @@ int pfn_valid(unsigned long pfn) } EXPORT_SYMBOL(pfn_valid); -#ifndef CONFIG_SPARSEMEM -static void __init arm64_memory_present(void) -{ -} -#else -static void __init arm64_memory_present(void) -{ - struct memblock_region *reg; - - for_each_memblock(memory, reg) { - int nid = memblock_get_region_node(reg); - - memory_present(nid, memblock_region_memory_base_pfn(reg), - memblock_region_memory_end_pfn(reg)); - } -} -#endif - static phys_addr_t memory_limit = PHYS_ADDR_MAX; /* @@ -489,7 +471,7 @@ void __init bootmem_init(void) * Sparsemem tries to allocate bootmem in memory_present(), so must be * done after the fixed reservations. */ - arm64_memory_present(); + memblocks_present(); sparse_init(); zone_sizes_init(min, max);