Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3352967pxk; Mon, 7 Sep 2020 10:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0pYnGMnc3oUwRf3qUnS76RXsmzJoqMv9kVwFiOhyjaQGslTRjsNGJ/SL5wQP5IiiFYdKT X-Received: by 2002:a17:906:1691:: with SMTP id s17mr23303804ejd.458.1599499370119; Mon, 07 Sep 2020 10:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599499370; cv=none; d=google.com; s=arc-20160816; b=DtYs7ipOci2WzVBMC1Ar8SVMA8f9ICcMBYz2fNsXaZdRdlNaE566HWum+TBZaB53DU K98hRNM1i90egDZvFXqa1j1FIY21MafWxoetmKXjFIMH0DeujSYITaAFyodQm0b3fNVb /vTxX5IqJphjrMEUAXgKcKjgNxI1BZOClgbhvCLQKNYFEpSCyTcnffzgiYtKITZ98LYr nqJwsCrQpoIiNbwbD7bs2dbklKUTq4prmf9VZgRucqlfK5kzslhQWb2WGN68AZbPAcJ4 V6tDiPMLlpiFBNMYH3srrepwHsyn5cyM6lAAzOecimTLEKERa1R9CM++fzRPY198o8fs Y7Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WqumYrkwNhTcJiZjIKIcgnY8rh/JEslxhX/UQmEu29A=; b=aWGfDOwmtTEXf3PVnnuYqd6RUqa9ocJHs5Sozt8KzqruGv24JnYLKV4UfkoVYZObXr vtkotI4NJhAOAkam+bVarCsTGqs6e2Tql1ytPO+7obs672zH0UBXxUlOTWskSrPYwZS/ cXrnHv4PwLGMsYB3P+2pRz3+GsI7V0hoxkqzi5M8frsn50SXOG6kEAPGuZWlFHDlM7Bs /9c0BDLE3n7bCNNQbua7Kz8jG01pF2aH7bmA5jK34FmREtZGkGerAmY4pnG5cgxQIqnV P4x5oEtfmEmie05dheDg6hKh3pVwLPknLIi5oTsNo0djXGwAbEVaTGJNx09YjBPUTMdM w4JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si10637375edl.399.2020.09.07.10.22.27; Mon, 07 Sep 2020 10:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731015AbgIGRVm (ORCPT + 99 others); Mon, 7 Sep 2020 13:21:42 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53026 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729668AbgIGNri (ORCPT ); Mon, 7 Sep 2020 09:47:38 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C048235DF6F689BCD2FB; Mon, 7 Sep 2020 21:46:53 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 21:46:46 +0800 From: Chen Zhou To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v12 1/9] x86: kdump: move CRASH_ALIGN to 2M Date: Mon, 7 Sep 2020 21:47:37 +0800 Message-ID: <20200907134745.25732-2-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200907134745.25732-1-chenzhou10@huawei.com> References: <20200907134745.25732-1-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_PHYSICAL_ALIGN can be selected from 2M to 16M and default value is 2M, so move CRASH_ALIGN to 2M, with smaller value reservation can have more chance to succeed. And replace the hard-coded alignment with macro CRASH_ALIGN in function reserve_crashkernel(). Suggested-by: Dave Young Signed-off-by: Chen Zhou --- arch/x86/include/asm/kexec.h | 3 +++ arch/x86/kernel/setup.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 6802c59e8252..83f200dd54a1 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h @@ -18,6 +18,9 @@ # define KEXEC_CONTROL_CODE_MAX_SIZE 2048 +/* 2M alignment for crash kernel regions */ +#define CRASH_ALIGN SZ_2M + #ifndef __ASSEMBLY__ #include diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3511736fbc74..296294ad0dd8 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -402,9 +402,6 @@ static void __init memblock_x86_reserve_range_setup_data(void) #ifdef CONFIG_KEXEC_CORE -/* 16M alignment for crash kernel regions */ -#define CRASH_ALIGN SZ_16M - /* * Keep the crash kernel below this limit. * @@ -530,7 +527,7 @@ static void __init reserve_crashkernel(void) start = memblock_find_in_range(crash_base, crash_base + crash_size, - crash_size, 1 << 20); + crash_size, CRASH_ALIGN); if (start != crash_base) { pr_info("crashkernel reservation failed - memory is in use.\n"); return; -- 2.20.1