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=-8.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 51F96C4741F for ; Thu, 5 Nov 2020 16:11:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9262E206B7 for ; Thu, 5 Nov 2020 16:11:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Nfm2u46y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9262E206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+AqFf3npEYS3kaZ0UftJqAB+cLcmSccLYo9HK1Proio=; b=Nfm2u46yY3vF30fO+Bphb9GZE IKGD/S6YWeFAEeXWfRFLNKXd0aRVOWBaGDBi+Zw/dN/T7dOJJfclnB/1Rh3LgwQI65lIhZ1000KTD w8PwXjMarILCx0VGL+bFwf5Tt7rkVU8JMhPAFTg8Rbjk6Ecmqi4EgEBhGouGA3jR/zGeZW0MB41sg 113hHoeSeeexjHGahBq+g/xPrxIYhINq8l9NF8tJYrg5IVnkpi6U7xi3EJLfT2mxIMfyMgQQTWit7 b8vyNg2zE0qfEqZYdlfSQihWyvgIVc126/W+t7v1pQkU93gFcbPehlN5AdWPohOyL25xpqnWInQhu 4iZPQLG6g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kahrI-0002sI-1o; Thu, 05 Nov 2020 16:11:32 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kahrF-0002rN-IK; Thu, 05 Nov 2020 16:11:30 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6F66514BF; Thu, 5 Nov 2020 08:11:25 -0800 (PST) Received: from [172.16.1.113] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A0BB3F718; Thu, 5 Nov 2020 08:11:17 -0800 (PST) Subject: Re: [PATCH v6 1/7] arm64: mm: Move reserve_crashkernel() into mem_init() To: Nicolas Saenz Julienne References: <20201103173159.27570-1-nsaenzjulienne@suse.de> <20201103173159.27570-2-nsaenzjulienne@suse.de> From: James Morse Message-ID: Date: Thu, 5 Nov 2020 16:11:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201103173159.27570-2-nsaenzjulienne@suse.de> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201105_111129_684194_F9FBCE2C X-CRM114-Status: GOOD ( 15.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, ardb@kernel.org, iommu@lists.linux-foundation.org, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, guohanjun@huawei.com, will@kernel.org, hch@lst.de, linux-arm-kernel@lists.infradead.org, robin.murphy@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi! On 03/11/2020 17:31, Nicolas Saenz Julienne wrote: > crashkernel might reserve memory located in ZONE_DMA. We plan to delay > ZONE_DMA's initialization after unflattening the devicetree and ACPI's > boot table initialization, so move it later in the boot process. > Specifically into mem_init(), this is the last place crashkernel will be > able to reserve the memory before the page allocator kicks in. > There > isn't any apparent reason for doing this earlier. It's so that map_mem() can carve it out of the linear/direct map. This is so that stray writes from a crashing kernel can't accidentally corrupt the kdump kernel. We depend on this if we continue with kdump, but failed to offline all the other CPUs. We also depend on this when skipping the checksum code in purgatory, which can be exceedingly slow. Grepping around, the current order is: start_kernel() -> setup_arch() -> arm64_memblock_init() /* reserve */ -> paging_init() -> map_mem() /* carve out reservation */ [...] -> mm_init() -> mem_init() I agree we should add comments to make this apparent! Thanks, James > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 095540667f0f..fc4ab0d6d5d2 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -386,8 +386,6 @@ void __init arm64_memblock_init(void) > else > arm64_dma32_phys_limit = PHYS_MASK + 1; > > - reserve_crashkernel(); > - > reserve_elfcorehdr(); > > high_memory = __va(memblock_end_of_DRAM() - 1) + 1; > @@ -508,6 +506,8 @@ void __init mem_init(void) > else > swiotlb_force = SWIOTLB_NO_FORCE; > > + reserve_crashkernel(); > + > set_max_mapnr(max_pfn - PHYS_PFN_OFFSET); > > #ifndef CONFIG_SPARSEMEM_VMEMMAP > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel