Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1871883pxx; Sat, 31 Oct 2020 00:41:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzK3K23EAJPxFk+54nJ1KmSHVZmW4vEhQTc4RQkppOmNiFro6SMrPRu2hINSOw1Z0Ji4IzH X-Received: by 2002:a17:906:6156:: with SMTP id p22mr5909962ejl.64.1604130060138; Sat, 31 Oct 2020 00:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604130060; cv=none; d=google.com; s=arc-20160816; b=DD5YAbCFdlObPaBxNkar7RJYsn5Oq1HmmXTV36luSI3ZH7itSmeTNxAH7qxIShZ8tm BNzw0uL/0ZBVD5fIVtRgHaFkSB9GYfJJz0+505VpViJcGiRS6MA713Kqe3Duc4EWBXnY CgG8aCuU2BixvgLXQiIQGpjt/EUqyjP3O4V5qKPG53jYX9b+TpqzhJHRTjFqD2NUoqtr sE7rGaXSJijiWBADVpZiL5sZhiJDlo7ulDayqRS82I0+v3T2gUJc71+1HmFRm0UWtbbp JlpGAv0Nknv5ft9HVoiXJypfXXLsghMBM7aLNSVGRHvt68wAtWXQ6Y6wfhwbxJ/K2Zns MYCA== 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=z+WKgvjpszjDR8QiJz7WuO4swZKbSBhbzCZXoyEtZm4=; b=tmNKymCN5OC0GWFbp591jMpPYSXUGSa+HL+TWdPjwAwZQJm7298uypILKh/GCjgAZB X4JOj3pAxjArRlZr7I0Pudk0kKA8OBRRNkxoe72M87JGIwsCKLy32b61aEVdo8NM31b9 gdvqxrKGANY8nXZg+EvpdRIsmBM2h45ddeXWMeKlEeyOonCModCUa+C7DTW5xoLOhc+P 8mQYVYmTN7z3NoihG5e3ohWSRnegVVlXk7T0BtSCS8l1D2pUX3liTdKr42QdjzYCmdrq 588cM6Zi+TeaslhF8gNWzM2VfcF2cVGP+XGbufnPnB8CzL6nKP/cp97IYppKktqiGb4i 20sA== 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 d19si5654262ejr.473.2020.10.31.00.40.37; Sat, 31 Oct 2020 00:41:00 -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 S1726400AbgJaHjN (ORCPT + 99 others); Sat, 31 Oct 2020 03:39:13 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:7384 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbgJaHjM (ORCPT ); Sat, 31 Oct 2020 03:39:12 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CNWJt5XbYz70y3; Sat, 31 Oct 2020 15:39:10 +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:39:00 +0800 From: Chen Zhou To: , , , , , , , , , CC: , , , , , , , , , , , , , , John Donnelly Subject: [PATCH v13 3/8] x86: kdump: use macro CRASH_ADDR_LOW_MAX in functions reserve_crashkernel() Date: Sat, 31 Oct 2020 15:44:32 +0800 Message-ID: <20201031074437.168008-4-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 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 d1599449a001..1289f079ad5f 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -491,8 +491,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. @@ -520,7 +521,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