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,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 1E531C5519F for ; Fri, 20 Nov 2020 03:56:16 +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 B533321D40 for ; Fri, 20 Nov 2020 03:56:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k9uRHR3E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B533321D40 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=z2M7XZ3uN7tZiOfkcEZZ+gYWUdxu1ehPMfRcWVxtyHQ=; b=k9uRHR3E/7nGg0+HW8AUOroiq zhc2VYyW2QTeTZqITJGAk+S4GB75xTwSLKa04wxH6drLV0NVg6Jk250pBbdXaLkrGVOyM6f0Ze9IP ldalZp48cmNfj6EAV+GCrL/qTsAs8p+YZRY4x/dIeXs5d/7QlpSqsGljdAmRQ0rFMbKuqIgu2xrNL Nu0l3fTGdXNKHED16AjWuwOgaC0q3t96ityr25P3KApPiHu7mx5f5gRutimM+jWNt7eoTJCATclBF P64vNfMq51PO4vDkX9iSEBRmg6/a5i891JVhBPZGlVIS2t8VCOQiSjWAHtKxDsVl+KoQphs6tFFuh zS/dfEtkQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfxWJ-00055S-1R; Fri, 20 Nov 2020 03:55:35 +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 1kfxWH-000556-66 for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 03:55:34 +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 3243C1396; Thu, 19 Nov 2020 19:55:26 -0800 (PST) Received: from [192.168.0.130] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 567E23F719; Thu, 19 Nov 2020 19:55:24 -0800 (PST) Subject: Re: [PATCH] arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required To: Catalin Marinas , linux-arm-kernel@lists.infradead.org References: <20201119175556.18681-1-catalin.marinas@arm.com> From: Anshuman Khandual Message-ID: <3c76d583-12c3-691d-50c6-564831e40534@arm.com> Date: Fri, 20 Nov 2020 09:25:22 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201119175556.18681-1-catalin.marinas@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_225533_321584_9262F1F7 X-CRM114-Status: GOOD ( 24.46 ) 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 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel