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 64320C5519F for ; Fri, 20 Nov 2020 11:10:12 +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 D527B22201 for ; Fri, 20 Nov 2020 11:10:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dni8Ts/M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D527B22201 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=1jo7vcxUXqvEkmVwdRaBOlpcceuuoWPolRlYQTP8K1I=; b=dni8Ts/MxR70tKkeUD6DNzDsP EuS32KeCjT4H/rLR8IaZQkm7HNtYedqgQ8f8EIm/GGZW94er/Mbgp7HEBd41ZfQaRCsjUv1PfCty3 jNtG67jdtJKFeaKqegs+UIQHcSX4UNor0OD2Hwv9y5JBGE7OhRqwGYXjdgw1FfX0QpZmMijkRqQA6 lTbG4O0Uqbd+XdzbfR8jP+VfWYnKJ2QLWYGD3eGY+bnXUj1+Oi6lvP75umbqRDCFAyOgPLiyfdrAx iIgsbC7X35zeVV3qaTwY0kj/j+mtEQxzWqfJ2YGxlrasfJvMJb2qX/eLi79ttvYFNuHq+KpH46f9I 7eDvoL8wg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg4Hl-0006ZT-6o; Fri, 20 Nov 2020 11:09:01 +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 1kg4Hi-0006Z3-BE for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 11:08:59 +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 4182611D4; Fri, 20 Nov 2020 03:08:51 -0800 (PST) Received: from [10.163.82.169] (unknown [10.163.82.169]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 615073F718; Fri, 20 Nov 2020 03:08:49 -0800 (PST) Subject: Re: [PATCH] arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required To: Catalin Marinas References: <20201119175556.18681-1-catalin.marinas@arm.com> <3c76d583-12c3-691d-50c6-564831e40534@arm.com> <20201120092326.GA24344@gaia> From: Anshuman Khandual Message-ID: Date: Fri, 20 Nov 2020 16:38:46 +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: <20201120092326.GA24344@gaia> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_060858_491193_16084F3D X-CRM114-Status: GOOD ( 22.70 ) 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 11/20/20 2:53 PM, Catalin Marinas wrote: > 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. Makes sense. > > Also note that with defconfig, we don't get block mappings anyway > (rodata_full). > Sure, seems alight then. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel