Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp585268imm; Wed, 29 Aug 2018 07:17:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaUaTj8l4OClDBjWqo1g0Bxjtn4h2LPzXEVdm2wr+boKyiOESmnmwplUNqv6WArjJFl7GQt X-Received: by 2002:a63:f206:: with SMTP id v6-v6mr6041533pgh.319.1535552275782; Wed, 29 Aug 2018 07:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535552275; cv=none; d=google.com; s=arc-20160816; b=MmhgxYO0Fd/UWq22kRubAfHWuM2m5bFL1WSZVK7QcQwqVaGrrJVA4mdTEz1tJa9YKt /uy2Nl3XU/4gfB6WICCDCDUWIquOYJsU51XmlxWBEdpUrr1//i3J/MlhQvEiV0kM05Pc Y1DRILNhMBEXm1HNY9khcLieh2ROUWrTdXkwuU2FSc4LOyBrFi+wAUSq0b7FdinS/AdR Za3rPr6aiHZ8349IUnz5xVl1oe/jHai4CMHiMLWQAdI/X2qI7DMq37C2M5xVo1X9mklI V1TAulPBf5JA9WIW/pxyAaoakruuHkTjWGClgCr2h+Ijeo+TqdkYSQceTUm/jtEMJ9u6 k5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=VqGV0FOJn7gdF5YZiD24ERhgMa1SGRL9GmpI6M1GoIo=; b=pGPWCuLIIVXmbiDo80vMcyq6ip6pECB19njaNL6cGQGMHNEyWsxYgWr+fgYvVntUkh Iyd56NMXl7/iPQoD6JN5l2nA/ocQHsTwLcDekuOBWGD3hATvOgz736InUe90WCXqA38o Rou6lMUpAp9bW1SZApJC70sDruZtgDWttVUzUcGmbIrkQFuSJ/Agma/lK8J4G7H85Tvx qsw2EkC5aN+RLeULW+7l3ZJFbcLAMJM4FrWUYVOedHi1/VdXsuAGEWiNonwLSkqCYHOY 6XwaHX3unAOBYjLLh7Or91+8mxgzJ9aHKvQnBGLf72dZPVlsC0RF12ZwhKYa6/rYnBkI LcwA== 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 e7-v6si3741792pgc.233.2018.08.29.07.17.41; Wed, 29 Aug 2018 07:17:55 -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 S1728836AbeH2SNl (ORCPT + 99 others); Wed, 29 Aug 2018 14:13:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727444AbeH2SNk (ORCPT ); Wed, 29 Aug 2018 14:13:40 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AE65807A0D0; Wed, 29 Aug 2018 14:16:30 +0000 (UTC) Received: from 192.168.1.2 (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABB6F1007242; Wed, 29 Aug 2018 14:16:26 +0000 (UTC) From: Baoquan He To: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, kirill.shutemov@linux.intel.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, Baoquan He Subject: [PATCH 0/3] Add restrictions for kexec/kdump jumping between 5-level and 4-level kernel Date: Wed, 29 Aug 2018 22:16:21 +0800 Message-Id: <20180829141624.13985-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 29 Aug 2018 14:16:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 29 Aug 2018 14:16:30 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This was suggested by Kirill several months ago, I worked out several patches to fix, then interrupted by other issues. So sort them out now and post for reviewing. The current upstream kernel supports 5-level paging mode and supports dynamically choosing paging mode during bootup according to kernel image, hardware and kernel parameter setting. This flexibility brings several issues for kexec/kdump: 1) Switching between paging modes, requires changes into target kernel. It means you cannot kexec() 4-level paging kernel from 5-level paging kernel if 4-level paging kernel doesn't include changes. 2) Switching from 5-level paging to 4-level paging kernel would fail, if kexec() put kernel image above 64TiB of memory. 3) Kdump jumping has similar issue as 2). This require us to only reserve crashkernel below 64TB, otherwise jumping from 5-level to 4-level kernel will fail. 4) The current kexec_load interface will put kernel at the top of system RAM. This also need be restricted to be under 64TB. However this is not an issue for kexec_file_load interface since it puts kernel at the top of lowest 4GB. I ever planned to unify these two's behavior to put kernel at top of system RAM the reason is we have been using the old kexec_load, and still more widely than kexec_file_load. Just the change involves too mamy lines of code change, seems people don't like it. Now I decide to give up the unifying thing, just leave with it, and add the restriction for kexec_load in kexec_tools unitilies. The unifying behaviour patches are: [PATCH v7 0/4] resource: Use list_head to link sibling resource http://lkml.kernel.org/r/20180718024944.577-1-bhe@redhat.com Note: The issues 1), 2) need be done in kernel for kexec_file_load interface. Meanwhile, 1), 2), and 4) need be done in user space kexec_tools utility. I will post patches later for user space fix. Issue 3) can only be done in kernel. Baoquan He (3): x86/boot: Add bit fields into xloadflags for 5-level kernel checking x86/kexec/64: Error out if try to jump to old 4-level kernel from 5-level kernel x86/kdump/64: Change the upper limit of crashkernel reservation arch/x86/boot/header.S | 12 +++++++++++- arch/x86/include/uapi/asm/bootparam.h | 2 ++ arch/x86/kernel/kexec-bzimage64.c | 5 +++++ arch/x86/kernel/setup.c | 18 ++++++++++++++---- 4 files changed, 32 insertions(+), 5 deletions(-) -- 2.13.6