Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2402002pxb; Sat, 30 Jan 2021 01:14:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTEk6sicT4hJTplg2qDKcufRvkkvuADKyv74zFUz3t+Aqz4lAcXmMifAba5vs9LoAcY4RT X-Received: by 2002:a17:907:3e06:: with SMTP id hp6mr8219203ejc.254.1611998087100; Sat, 30 Jan 2021 01:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611998087; cv=none; d=google.com; s=arc-20160816; b=hp6VaoUockOQlkDd+8yOP6zO+hAcef0Fs5DODY8rbcMj300GZ9s+iodG7/pW6cjUIE MoHWhIrbvfbCuoXrWovg/AJ1AA1Q+3lsdNPkHbBds2mnBm3xxZERdmfuPULCvs7OI18h MkP53SlRk1TS3utBx8CdDZZxW2XQoF4sSqUJrump4bMCD3JxyYE0ylOJaworHd1r/2qV buXh4vbzce0qQQdhaZf7z71/VcUVNUDIaUtzotgHcnVI0kYWNm7yRLKYBWDqrXi3FCK7 KuoZeOlvixPf1gFWAAMrQWce2YhExuKrx4dMHvok9YwJQxQ2LHpRK+HAGwPt1S67o4IB LOVQ== 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=oFNR7Ya5S9e5gOUURtcOB2mZzPyrkkG9Gcl1Cj/ccbo=; b=AedR8MCpTMPFCCw8izQGPgUakaxTQ6uWEWGfCHjTCooTCUYiQdIUb5wyBMHSWBB0GE aUXt9PYbLMKSl5CjGHjjuaazruCYpgmurc7BBshjAKjGxavN/wbAFD49q2DSnlYDP2k3 doquzIWonGJn6oFK2DKnH33q2yirpd24X6BAYVHIp5rY0mcCg8PwlwUCm6ta2dYxPneL 5JGYQzLH+39p/PRLsV7zVYs2NriTs/fIzt2cDpP0QjG3gnz+trzIbvjk1bJYsGNefzJa j2/uKkqUPB9ks9oNZMAmiXXEq1NcgFF8+q79tD8zesv8xulK5uiztkeUBnM+d6bcDndr RWLw== 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 f22si6256428ejq.233.2021.01.30.01.14.23; Sat, 30 Jan 2021 01:14:47 -0800 (PST) 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 S231882AbhA3JNp (ORCPT + 99 others); Sat, 30 Jan 2021 04:13:45 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:11949 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231903AbhA3JNA (ORCPT ); Sat, 30 Jan 2021 04:13:00 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DSQFc45TJzjF7n; Sat, 30 Jan 2021 15:05:08 +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.498.0; Sat, 30 Jan 2021 15:06:01 +0800 From: Chen Zhou To: , , , , , , , , , , , CC: , , , , , , , , , , , , , John Donnelly Subject: [PATCH v14 01/11] x86: kdump: replace the hard-coded alignment with macro CRASH_ALIGN Date: Sat, 30 Jan 2021 15:10:15 +0800 Message-ID: <20210130071025.65258-2-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210130071025.65258-1-chenzhou10@huawei.com> References: <20210130071025.65258-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 for later use. Besides, the alignment of crash kernel regions in x86 is 16M(CRASH_ALIGN), but function reserve_crashkernel() also used 1M alignment. So just replace hard-coded alignment 1M with macro CRASH_ALIGN. Suggested-by: Dave Young Suggested-by: Baoquan He 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..be18dc7ae51f 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 +/* 16M 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 3412c4595efd..da769845597d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -390,9 +390,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. * @@ -510,7 +507,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