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.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 C83B2C5519F for ; Fri, 20 Nov 2020 09:24:00 +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 32D3F22264 for ; Fri, 20 Nov 2020 09:24:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NVvkZtVB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32D3F22264 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:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rOkRgf+iox9Ayb0zFzd0uUZRlDj/iL0WSLFQiLe81yc=; b=NVvkZtVBscfHmlsLhVJoEwNt4 FbA0FFRAP8t4AJrGE00iacRHCdcubZb2tQerv64ZqDTQVVjNO7WPIWIo0/7ju6LoF4GAV3PUcIzL9 MvmTEecy02xL22l3InOy2N/E5hkqMmRR5YPmN5EQTlr+Sl0hVrAdfGIIDeBeIXBCdcSS71Nd5Y3ka wZfAFrEWoQJZbN3mSlu31+v16yvDdiQIKV3ekOhkHphvZOAfCAQB+H6lM6IT+q81mElf4zM93wlZt wQQjPnwWGbvll2rV/fJhUHx2fe+kKFyiGLRtL2h3jWCUB3Y+FwYQiTQpYJ1q8/zVlBg6nw0NRb24p TMQmXk2Gw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg2di-00005K-NK; Fri, 20 Nov 2020 09:23:34 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg2df-0008WH-VJ for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 09:23:33 +0000 Received: from gaia (unknown [2.26.170.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A224B22226; Fri, 20 Nov 2020 09:23:29 +0000 (UTC) Date: Fri, 20 Nov 2020 09:23:27 +0000 From: Catalin Marinas To: Anshuman Khandual Subject: Re: [PATCH] arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required Message-ID: <20201120092326.GA24344@gaia> References: <20201119175556.18681-1-catalin.marinas@arm.com> <3c76d583-12c3-691d-50c6-564831e40534@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3c76d583-12c3-691d-50c6-564831e40534@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_042332_470444_52F6C129 X-CRM114-Status: GOOD ( 27.39 ) 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: Will Deacon , James Morse , Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org 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 On Fri, Nov 20, 2020 at 09:25:22AM +0530, Anshuman Khandual wrote: > On 11/19/20 11:25 PM, Catalin Marinas wrote: > > mem_init() currently relies on knowing the boundaries of the crashkernel > > reservation to map such region with page granularity for later > > unmapping via set_memory_valid(..., 0). If the crashkernel reservation > > is deferred, such boundaries are not known when the linear mapping is > > created. Simply parse the command line for "crashkernel" and, if found, > > create the linear map with NO_BLOCK_MAPPINGS. > > > > Signed-off-by: Catalin Marinas > > Cc: James Morse > > Cc: Nicolas Saenz Julienne > > --- > > > > Following the online (and offline) discussion with James and Nicolas, > > this aims to avoid issues with moving the reserve_crashkernel() call to > > after the memory map has been created (the ZONE_DMA patches). > > > > https://lore.kernel.org/r/e60d643e-4879-3fc3-737d-2c145332a6d7@arm.com > > > > arch/arm64/mm/mmu.c | 37 ++++++++++++++++--------------------- > > 1 file changed, 16 insertions(+), 21 deletions(-) > > > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > > index d7fe72ee678a..dd214157a026 100644 > > --- a/arch/arm64/mm/mmu.c > > +++ b/arch/arm64/mm/mmu.c > > @@ -469,6 +469,21 @@ void __init mark_linear_text_alias_ro(void) > > PAGE_KERNEL_RO); > > } > > > > +static bool crash_mem_map __initdata; > > + > > +static int __init enable_crash_mem_map(char *arg) > > +{ > > + /* > > + * Proper parameter parsing is done by reserve_crashkernel(). We only > > + * need to know if the linear map has to avoid block mappings so that > > + * the crashkernel reservations can be unmapped later. > > + */ > > + crash_mem_map = true; > > + > > + return 0; > > +} > > +early_param("crashkernel", enable_crash_mem_map); > > Should not the crash kernel cmdline parameter gets parsed enough, just to > ensure it is atleast a valid one ? Otherwise an invalid cmdline request > can prevent the block mapping. In that case, the kernel will neither have > a crash kernel nor the block mapping. Does it actually matter? If people pass random strings on the command line, they should expect some side-effects. That's about the intention to have a crashkernel. We can't fully validate the crashkernel parameter until we know the zones layout. Also note that with defconfig, we don't get block mappings anyway (rodata_full). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel