Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2402657pxb; Sat, 30 Jan 2021 01:16:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFh/n1erAUtNd5isR7azt6E34yWzaY0kCmII03iDTMEh/1AxfzdCMieJQYEmry8ekqOUB8 X-Received: by 2002:aa7:c34f:: with SMTP id j15mr9175417edr.120.1611998169605; Sat, 30 Jan 2021 01:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611998169; cv=none; d=google.com; s=arc-20160816; b=yihFE8qeRjM18vwKx8mSz1hUqom2VzUI1iAVgS16SMF/sMB6GGTU7aPxTzjvNxEBtI g4WPkkpJiKVggOv8dnY94XoFEbwhquzKdDdmm661bfhdWN0G4TTSU1/fdhLlicyjsbNE LMj00XxViv5ZeZFIdiEyQ771ZY0+9y1idYo9s1mHQON6Fpivly0FoxMfA9vaL8jdmTkY K63tjDJwiwLgVR+NeqeCG26RRSnZjv7O+JFSKRhPBoCCkmr5lHe99nZzkH6gZcANfJFH 29BreDk5P0m6/2/2CeTaZWppLZ5HnH72/CWHJiNH3D7QioctQQb/ErLbrYtOzUP0gnJ8 RkUA== 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=OkVGq0JLTEct8dlhEqZqSBYVWQcIRvTDKtssAsaovd0=; b=kml7KewzPafE3W4IEzkSGsNW1rvJSwnV8LfYBajTx4c3qB8iBARsRllQthUGE39+LF k2xJrHCMkRhub5zR2SZ2pZrnWFF9HW7+0TXcigkMMKJEsL1kxeFCCTvSaGqpZlbwt57x 4tC88wVD3wPPDsfOe77A8slpCUBvpvgpLNNLGE7+tLvnysVbbJxkd6YD74sjRO3UpuBJ z0xOuDgKg319A0fG0jaD+5MEJO6z/M4P+iGf7Pq/TH2AyXBQhFAQlwE+zFniA/lUeMqD +LNBnSz+FfGnmVzinr+ko0nRVxtF0fQUBo8E7uc/MkhqytMeeMuhx6aroaDvPi5Y9xPo 3zwg== 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 lv10si6715372ejb.505.2021.01.30.01.15.45; Sat, 30 Jan 2021 01:16:09 -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 S233656AbhA3JOh (ORCPT + 99 others); Sat, 30 Jan 2021 04:14:37 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:11953 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231967AbhA3JOD (ORCPT ); Sat, 30 Jan 2021 04:14:03 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DSQFj541SzjFJ8; Sat, 30 Jan 2021 15:05:13 +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:03 +0800 From: Chen Zhou To: , , , , , , , , , , , CC: , , , , , , , , , , , , , John Donnelly Subject: [PATCH v14 03/11] x86: kdump: use macro CRASH_ADDR_LOW_MAX in functions reserve_crashkernel() Date: Sat, 30 Jan 2021 15:10:17 +0800 Message-ID: <20210130071025.65258-4-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 To make the functions reserve_crashkernel() as generic, replace some hard-coded numbers with macro CRASH_ADDR_LOW_MAX. Signed-off-by: Chen Zhou Tested-by: John Donnelly --- arch/x86/kernel/setup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 27470479e4a3..086a04235be4 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -487,8 +487,9 @@ static void __init reserve_crashkernel(void) if (!crash_base) { /* * Set CRASH_ADDR_LOW_MAX upper bound for crash memory, - * crashkernel=x,high reserves memory over 4G, also allocates - * 256M extra low memory for DMA buffers and swiotlb. + * crashkernel=x,high reserves memory over CRASH_ADDR_LOW_MAX, + * also allocates 256M extra low memory for DMA buffers + * and swiotlb. * But the extra memory is not required for all machines. * So try low memory first and fall back to high memory * unless "crashkernel=size[KMG],high" is specified. @@ -516,7 +517,7 @@ static void __init reserve_crashkernel(void) } } - if (crash_base >= (1ULL << 32) && reserve_crashkernel_low()) { + if (crash_base >= CRASH_ADDR_LOW_MAX && reserve_crashkernel_low()) { memblock_free(crash_base, crash_size); return; } -- 2.20.1