Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp181709yba; Wed, 8 May 2019 18:40:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGiH6++B2Ahf75GaeXbV05w5RWPp8k4LvuoS663hMeztw/E8w0U0cCXVsmfw+acQaKIl61 X-Received: by 2002:a17:902:7d96:: with SMTP id a22mr1483931plm.338.1557366014795; Wed, 08 May 2019 18:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557366014; cv=none; d=google.com; s=arc-20160816; b=Y/RXKU8KJejvjpjOeEyUvstgcQDzZIBCztAyTIg1UhU4MLEhXTi7geAflMLSv8yiOo fnjuEiVT62ioif4uymJqqGXRqs8CaLpm4RC/RD/3gqyJ0cxuPCrInAvHFDompm86YwwY ka3ByQbOlC2fuM5Ci9S8Iwp6ZGyYSPP8aZme7+H2shOn4WRV1Sgzvjby5nS2PKxKir0q 324kiJyRwFuCWWLq2HjgPFgP7/TFZayvvdI+LQuSFYnZ38zTprAKcn6rTVeNIjcI3COz s8HEORX/kP6bhsaZmxm/9fAYGf4wpQ+cV1E/unUEwtrhYoayWY4o0d0VY27Ye+Bj64xs roYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=NDpAwUIJKLJP+zhbQQD/5sSkXSabZFhCL1EEbQ3b3Ec=; b=wDiQ/xolFid2QyeU7mTQYcSfwaNm8lDjY6w73M5IsscUO18tJ8OLJZwaq1asw2iG17 1PHC5iUOHqKXuG799IBZ/0FwtiCyYNAli2wnhwHFUROgRLEFYAa+lz7RhNq5QJTugf21 5M4P3/0VkX/kDh7vRgLuW17RG5cIPO7loHjleRLbiZ1grPKta3VFani3YzHqiW36DTmD PMBw2Nxgq3K+yvbrGBlKWUtmWYRQ4qjTkribI3Ygbte3ab3lp/mJKjE9bOBhO4ViDE+W 4RGqgNn7DjgVBZZwUEMzjXuXV/wvsKngwXRqZbvsiyjbONC2SZVIcQVBxNW7wpIkjvu7 LkYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si747975pfh.147.2019.05.08.18.39.58; Wed, 08 May 2019 18:40:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbfEIBhH (ORCPT + 99 others); Wed, 8 May 2019 21:37:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56720 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbfEIBhF (ORCPT ); Wed, 8 May 2019 21:37:05 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD19FC045129; Thu, 9 May 2019 01:37:04 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-17.pek2.redhat.com [10.72.12.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCF87451A; Thu, 9 May 2019 01:37:01 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, hpa@zytor.com, kirill.shutemov@linux.intel.com, x86@kernel.org, dyoung@redhat.com, Baoquan He Subject: [PATCH v4 3/3] x86/kdump/64: Change the upper limit of crashkernel reservation Date: Thu, 9 May 2019 09:36:44 +0800 Message-Id: <20190509013644.1246-4-bhe@redhat.com> In-Reply-To: <20190509013644.1246-1-bhe@redhat.com> References: <20190509013644.1246-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 09 May 2019 01:37:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Restrict kdump to only reserve crashkernel below 64TB. The reaons is that the kdump may jump from 5-level to 4-level, and if the kdump kernel is put above 64TB, then the jumping will fail. While the 1st kernel reserves crashkernel region during bootup, we don't know yet which kind of kernel will be loaded after system bootup, 5-level kernel or 5-level kernel. Signed-off-by: Baoquan He Acked-by: Kirill A. Shutemov --- arch/x86/kernel/setup.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 905dae880563..efb0934a46f6 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -452,15 +452,26 @@ static void __init memblock_x86_reserve_range_setup_data(void) #define CRASH_ALIGN SZ_16M /* - * Keep the crash kernel below this limit. On 32 bits earlier kernels - * would limit the kernel to the low 512 MiB due to mapping restrictions. + * Keep the crash kernel below this limit. + * + * On 32 bits earlier kernels would limit the kernel to the low + * 512 MiB due to mapping restrictions. + * + * On 64bit, old kexec-tools need to be under 896MiB. The later + * supports to put kernel above 4G, up to system RAM top. Here + * kdump kernel need be restricted to be under 64TB, which is + * the upper limit of system RAM in 4-level paing mode. Since + * the kdump jumping could be from 5-level to 4-level, the jumping + * will fail if kernel is put above 64TB, and there's no way to + * detect the paging mode of the kernel which will be loaded for + * dumping during the 1st kernel bootup. */ #ifdef CONFIG_X86_32 # define CRASH_ADDR_LOW_MAX SZ_512M # define CRASH_ADDR_HIGH_MAX SZ_512M #else # define CRASH_ADDR_LOW_MAX SZ_4G -# define CRASH_ADDR_HIGH_MAX MAXMEM +# define CRASH_ADDR_HIGH_MAX (64UL << 40) #endif static int __init reserve_crashkernel_low(void) -- 2.17.2