Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp131545pxb; Thu, 14 Jan 2021 21:56:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgtDqk0fyL16WOrAgpa6XZFOO79ydqWED0VNxxXjFQXhgzkfPHGNkWrS7a16DKmakGBzY9 X-Received: by 2002:a17:906:3899:: with SMTP id q25mr7543751ejd.173.1610690172876; Thu, 14 Jan 2021 21:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610690172; cv=none; d=google.com; s=arc-20160816; b=hoVuc3EYed/MtazLiKSOw5gHazakpmtYrKoIvXYX3KRrjZ1RioUHBxURKKv+GThHT5 S7dvm6u0BXeSwIsHg9soYFPn66Gb5+1unK2q3l4KVtvuwAILmJCUbTsCGC9Bb6y4QRcR FpD8aWn7IbSGontVazxu8np27tptJ7y3vl9FCdmCiaORgt6zcIOsSj+Pdg+QrbKPTEGm msDt0NxdfGyHeVL84Sj+5YSbyHtJyRKqd3xoBm78buIfEb7pD50a2dBMmXIDu3Jt3DFy LpF5Et0/USnen+F/YkXAmdxUEXHsg+q0/02Tzkhf1UOTRB1uW+nQbQmzc4+uu/V58V2O UfWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=XdAwh0p5DDod46gjGpLtGB9LqK9CDehwSk/6GnuuN3k=; b=e7cgbTqAOXVaQWz04Pjlm3e5d4fjS2nugeWG4l+MDGPp1z3o5V6kIAzXUWBjaYuGTw jfBmQDLCafwlAcnMXiXESFv6SRqPI8gjJu+rM8R+ykAv0DqXDm0a7cn4EPkX24BzUy5G L/Zvl22OvMwpp7zvg8sHBB8A8VxmdH/U24TwzovFwtv7/tjTtThUfyYR9ShX/q4ClgSi 8sRT9DAefOYqDMBop9aX1gaB86c66SQWJqCkOPY0cAaysVQlOKFYhlrF6xaX9De6GL3n rdJwYngYGrk/60EdW0GoVYZ841AzcxR/x9ypXQWAzEEah0rUQfoGySIECLNaa/MVyWnO G2+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si3430374edm.144.2021.01.14.21.55.49; Thu, 14 Jan 2021 21:56:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732045AbhAOFln (ORCPT + 99 others); Fri, 15 Jan 2021 00:41:43 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11019 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733061AbhAOFlc (ORCPT ); Fri, 15 Jan 2021 00:41:32 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DH9431tJJzj7ns; Fri, 15 Jan 2021 13:39:47 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Fri, 15 Jan 2021 13:40:42 +0800 From: Kefeng Wang To: , , , Russell King , , Atish Patra CC: Palmer Dabbelt , , Paul Walmsley , Kefeng Wang Subject: [PATCH v3 3/4] ARM: Covert to reserve_initrd_mem() Date: Fri, 15 Jan 2021 13:46:05 +0800 Message-ID: <20210115054606.124502-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210115054606.124502-1-wangkefeng.wang@huawei.com> References: <20210115054606.124502-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(); -- 2.26.2