Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3120310imw; Mon, 11 Jul 2022 02:10:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1txmmcEg9PYCph3t+6/0Kj5p//RELri/+EYulQYNb5oDfqUDbITEwuqM7UifcGKZiRbxbFE X-Received: by 2002:a63:4b03:0:b0:40d:9515:2863 with SMTP id y3-20020a634b03000000b0040d95152863mr14298332pga.341.1657530633957; Mon, 11 Jul 2022 02:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657530633; cv=none; d=google.com; s=arc-20160816; b=hs7l/MjFkwgzMA6jB35ZWDvmZViFq1TWpc5ohhVgsoc51Xifrr5S5tRAUPvCpMt5uP HekBjfhj0WyEGWvjRvkYQtUB4Mvr9miT7qts6DXmj56eIKxGhYCIWVudaShErkKds8wn +c/n9reGnClfa/rm7hTz8AItvEyy6sv+MF4+ImuqMqPUsx3aGX2Gsgeue6d5InKhtCSl 9VBhV+MK8cWBoraf2SO+X25guLqDcjFf2+tLxbjPU/3lnQNoS8yRHUMcAuoFxQMcSgTw PyIThpvHiZIV0jDB5OwcFkjv5oBsPOqA1XEYvPgqjwp6v8ycf10WHe5OvN15sfHMyyH+ jGDQ== 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=NdtaOg0YE916Vk5YVFbsRHFPAZhndpKv9l4hb6/6dA8=; b=OwnVgaphF78JuEvN2NsmjpAk9ZrLC3mJGDmLCLsjyFV35iM2zhyIRz/WS1NLWQONeH sBXFzzTEEvoI50S1i4kMLOrNPTfe13gCBVCZETk3FrVbOBMSF4nFQqC+tMbEqZq7u8G3 l0CJDZqZUchvspBZfW8XSkUojfREanZ+YwbHLTmTBrGATUi9QXZzZaaEZm8U+oJP++PD AixnTlL4rK5wegITM5RGBD0hgiFdVK2l6I1FWglo91perMMoKXst+N9u6CK4I/332KbL dyG8sVFkC0bb9r14yjOhp4szKTCHHaOlCofSW9VkOsjLm+/qkiF/eDYe5G7+Eq80jTqR NsIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020a17090a898100b001ca8baaa48fsi11713370pjn.120.2022.07.11.02.10.20; Mon, 11 Jul 2022 02:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbiGKJE5 (ORCPT + 99 others); Mon, 11 Jul 2022 05:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbiGKJEu (ORCPT ); Mon, 11 Jul 2022 05:04:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30BD3C36; Mon, 11 Jul 2022 02:04:49 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LhHvs54cgzkWbt; Mon, 11 Jul 2022 17:02:33 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 11 Jul 2022 17:04:42 +0800 Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 11 Jul 2022 17:04:41 +0800 From: Zhen Lei To: Dave Young , Baoquan He , Vivek Goyal , , , Catalin Marinas , Will Deacon , , Jonathan Corbet , CC: Zhen Lei , "Eric W . Biederman" , Randy Dunlap , Feng Zhou , Kefeng Wang , "Chen Zhou" , John Donnelly , Dave Kleikamp Subject: [PATCH v3 1/2] arm64: kdump: Provide default size when crashkernel=Y,low is not specified Date: Mon, 11 Jul 2022 17:03:18 +0800 Message-ID: <20220711090319.1604-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20220711090319.1604-1-thunder.leizhen@huawei.com> References: <20220711090319.1604-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To be consistent with the implementation of x86 and improve cross-platform user experience. Try to allocate at least 256 MiB low memory automatically for the case that crashkernel=,high is explicitly specified, while crashkenrel=,low is omitted. Signed-off-by: Zhen Lei Acked-by: Baoquan He --- Documentation/admin-guide/kernel-parameters.txt | 8 +------- arch/arm64/mm/init.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 2522b11e593f239..65a2c3a22a4b57d 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -843,7 +843,7 @@ available. It will be ignored if crashkernel=X is specified. crashkernel=size[KMG],low - [KNL, X86-64] range under 4G. When crashkernel=X,high + [KNL, X86-64, ARM64] range under 4G. When crashkernel=X,high is passed, kernel could allocate physical memory region above 4G, that cause second kernel crash on system that require some amount of low memory, e.g. swiotlb @@ -857,12 +857,6 @@ It will be ignored when crashkernel=X,high is not used or memory reserved is below 4G. - [KNL, ARM64] range in low memory. - This one lets the user specify a low range in the - DMA zone for the crash dump kernel. - It will be ignored when crashkernel=X,high is not used - or memory reserved is located in the DMA zones. - cryptomgr.notests [KNL] Disable crypto self-tests diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 339ee84e5a61a0b..5390f361208ccf7 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -96,6 +96,14 @@ phys_addr_t __ro_after_init arm64_dma_phys_limit = PHYS_MASK + 1; #define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit #define CRASH_ADDR_HIGH_MAX (PHYS_MASK + 1) +/* + * This is an empirical value in x86_64 and taken here directly. Please + * refer to the code comment in reserve_crashkernel_low() of x86_64 for more + * details. + */ +#define DEFAULT_CRASH_KERNEL_LOW_SIZE \ + max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20) + static int __init reserve_crashkernel_low(unsigned long long low_size) { unsigned long long low_base; @@ -147,7 +155,9 @@ static void __init reserve_crashkernel(void) * is not allowed. */ ret = parse_crashkernel_low(cmdline, 0, &crash_low_size, &crash_base); - if (ret && (ret != -ENOENT)) + if (ret == -ENOENT) + crash_low_size = DEFAULT_CRASH_KERNEL_LOW_SIZE; + else if (ret) return; crash_max = CRASH_ADDR_HIGH_MAX; -- 2.25.1