Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1871876pxx; Sat, 31 Oct 2020 00:40:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpf0XWQVvPyF1sNnHMXrLeCT08k0vyDKLQ7UX1WKMfJTDSg4f7w74Jz+mXH8HV9vcLC/xW X-Received: by 2002:a17:906:114b:: with SMTP id i11mr5434298eja.106.1604130059205; Sat, 31 Oct 2020 00:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604130059; cv=none; d=google.com; s=arc-20160816; b=aMEurcliGA8nUOBdaSSJfqEiY87D8hhW8g1EpNB+FDGn9A7SARv+efOn5xUPY3+zuu hTWwrRjpzfGUUoJPDno9D9uxp7h/0fKsn3KZqYU3tPUIzzPRCaYn+wNuP+AhApogqcVf tBUAeCx2RnSdwL63e20uPWXmUl8QZT5BVr+kg8kg6KBIzzd2XBRsRl2XZaa2zhOGL60h XdUhPLRZDdAoJ+xRNsk15GajDqzm2bqvukkEKsGRv1774pMGN5Nza1nB6W3BeL6dQ8dJ HEGNEl9zSd5poKw743ayc1/wyfQ/jJeCQJWyABtvD7JOaSYZ0V+DttT4t3DpgP8mHn9i Ofxw== 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=vizpck8eMf4CQY7S5Wtr7Q06/+Dl3CTIXXH+EghFQVo=; b=tguCzXDJtE0Ee75UARXAOobckCdEM9rK+Ctcg5eUvRIvRgGZRubfRqdnYSGDKj72RX z7S0RGSqivVlRV09DP7YhlVzLziYcidMB/olEDjC6AwiIz1sFAwCCrQjG5FzEzs03nMV zjwduE1NJWQBsweoXVDsY12Cla8pYXy09WtQ8oeSsLmYbDjL/+FYRsVp9mmDBIel3RTJ olOKs+ARVMlG55FFFU7dOiOn4CBR+m1oM0yIkXP2l1BBn0/6L1uqCPtkPpDT4Dus6Ri9 yL4eRjwwxoQjAG99SOVUou/0J34mRgOgAsU1Gv1aqeC07OsUM1B1ESqWQhCy0JOFpl7y ETjw== 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 o22si7900931edr.480.2020.10.31.00.40.33; Sat, 31 Oct 2020 00:40:59 -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 S1726356AbgJaHjH (ORCPT + 99 others); Sat, 31 Oct 2020 03:39:07 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7122 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbgJaHjH (ORCPT ); Sat, 31 Oct 2020 03:39:07 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CNWJm0cl8zLrGT; Sat, 31 Oct 2020 15:39:04 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Sat, 31 Oct 2020 15:38:58 +0800 From: Chen Zhou To: , , , , , , , , , CC: , , , , , , , , , , , , , , John Donnelly Subject: [PATCH v13 1/8] x86: kdump: replace the hard-coded alignment with macro CRASH_ALIGN Date: Sat, 31 Oct 2020 15:44:30 +0800 Message-ID: <20201031074437.168008-2-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201031074437.168008-1-chenzhou10@huawei.com> References: <20201031074437.168008-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move CRASH_ALIGN to header asm/kexec.h and replace the hard-coded alignment with macro CRASH_ALIGN in function reserve_crashkernel(). Suggested-by: Dave Young Signed-off-by: Chen Zhou Tested-by: John Donnelly --- 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..8cf9d3fd31c7 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_16M + #ifndef __ASSEMBLY__ #include diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 84f581c91db4..bf373422dc8a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -395,9 +395,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. * @@ -515,7 +512,7 @@ static void __init reserve_crashkernel(void) } else { unsigned long long start; - start = memblock_phys_alloc_range(crash_size, SZ_1M, crash_base, + start = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, crash_base, crash_base + crash_size); if (start != crash_base) { pr_info("crashkernel reservation failed - memory is in use.\n"); -- 2.20.1