From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB313C433E0 for ; Sun, 17 Jan 2021 05:09:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 611D123117 for ; Sun, 17 Jan 2021 05:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbhAQE7p (ORCPT ); Sat, 16 Jan 2021 23:59:45 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11031 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbhAQE7h (ORCPT ); Sat, 16 Jan 2021 23:59:37 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DJN2j4k0lzj3fR; Sun, 17 Jan 2021 12:57:49 +0800 (CST) Received: from [10.174.177.244] (10.174.177.244) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Sun, 17 Jan 2021 12:58:52 +0800 Subject: Re: [PATCH v3 3/4] ARM: Covert to reserve_initrd_mem() To: , , , Russell King , , Atish Patra CC: Palmer Dabbelt , , Paul Walmsley References: <20210115054606.124502-1-wangkefeng.wang@huawei.com> <20210115054606.124502-4-wangkefeng.wang@huawei.com> From: Kefeng Wang Message-ID: <07838e5e-de03-8caf-6599-e516c35cc3c8@huawei.com> Date: Sun, 17 Jan 2021 12:58:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20210115054606.124502-4-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.177.244] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org update Russell's mail address. On 2021/1/15 13:46, Kefeng Wang wrote: > Covert to the generic reserve_initrd_mem() function. > > Signed-off-by: Kefeng Wang > --- > arch/arm/mm/init.c | 43 +------------------------------------------ > 1 file changed, 1 insertion(+), 42 deletions(-) > > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index 828a2561b229..a29e14cd626c 100644 > --- a/arch/arm/mm/init.c > +++ b/arch/arm/mm/init.c > @@ -153,47 +153,6 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) > return phys; > } > > -static void __init arm_initrd_init(void) > -{ > -#ifdef CONFIG_BLK_DEV_INITRD > - phys_addr_t start; > - unsigned long size; > - > - initrd_start = initrd_end = 0; > - > - if (!phys_initrd_size) > - return; > - > - /* > - * Round the memory region to page boundaries as per free_initrd_mem() > - * This allows us to detect whether the pages overlapping the initrd > - * are in use, but more importantly, reserves the entire set of pages > - * as we don't want these pages allocated for other purposes. > - */ > - start = round_down(phys_initrd_start, PAGE_SIZE); > - size = phys_initrd_size + (phys_initrd_start - start); > - size = round_up(size, PAGE_SIZE); > - > - if (!memblock_is_region_memory(start, size)) { > - pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n", > - (u64)start, size); > - return; > - } > - > - if (memblock_is_region_reserved(start, size)) { > - pr_err("INITRD: 0x%08llx+0x%08lx overlaps in-use memory region - disabling initrd\n", > - (u64)start, size); > - return; > - } > - > - memblock_reserve(start, size); > - > - /* Now convert initrd to virtual addresses */ > - initrd_start = __phys_to_virt(phys_initrd_start); > - initrd_end = initrd_start + phys_initrd_size; > -#endif > -} > - > #ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND > void check_cpu_icache_size(int cpuid) > { > @@ -215,7 +174,7 @@ void __init arm_memblock_init(const struct machine_desc *mdesc) > /* Register the kernel text, kernel data and initrd with memblock. */ > memblock_reserve(__pa(KERNEL_START), KERNEL_END - KERNEL_START); > > - arm_initrd_init(); > + reserve_initrd_mem(); > > arm_mm_memblock_reserve(); >