Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3509821imm; Wed, 5 Sep 2018 01:04:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ3LqT8A9iePiv4yWghppKjo8R9fLA0Lnf9epgx3ftbNWMJ3KpfsE8mJP9Jh7PMS0k/NeUK X-Received: by 2002:a62:1192:: with SMTP id 18-v6mr39508376pfr.54.1536134676026; Wed, 05 Sep 2018 01:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536134675; cv=none; d=google.com; s=arc-20160816; b=KuZbGvryo9qnz0ZhCU7kGPCS9PfTLLcqbKJIsIGAgQBIhLcnSuy3eKb6zxONSRygig nh+SgScs25ujWmOj2IKWFAUnqF/Jhm8Vct7zfEW7f3/iStZifnk87JMJoTLdM58bAjV2 rWX6j4BLxfJYW4LWCjq9x8z5o5VqTldddFZ9dsBdRbbpKUJWYWVct9Fm/NktST6NLXep MFbIFrpMPrje4jptj+SJYipNGBkIMQ6bz4d16GqRTawxejUo2r09HIqdNQ17pfCC+BhU A3P6ju4lCnUux0ry3tVQlTQvBL0U/0DCHPOEmOO6GYyVT0MtfPHd9IfUIKGFZptkSjHM k5Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=pVQHv6PPPK00JZ1TarPzNtadjR8pbCaCYvmo29U3QGA=; b=JFqV2bt7VrngQbO1cqRwSFyeP99T3oFjpcp82XJuIouqgrBPkINlMRGj9efB/WE1Mp F4tOiBPgNv+opnvglDXRYFjq+Y4BPkoj+hsO8rYV0goX5+bXvdAs6iL8FwaibOX0+jTl +D3c+ClHns9IkYiD/ky+m1MckT3HL2CGDLdkB61uoQvtcJjSiu+efm9pk6EmY+whJAUD XTlxr3i6PxhaFkrEdRMfakqQWPm3Ipj1UlITLOqITQDiZLNe6tkGMxUYnFwAxxrvi2Xw LIovdxN4/7HzkQ8R7ppXRjFel186SYxzXxtkTfLqXzM8qpr7W7JhInw9lc+BZWppVFpd /RIg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15-v6si1494607pln.137.2018.09.05.01.04.20; Wed, 05 Sep 2018 01:04:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727740AbeIEMcC (ORCPT + 99 others); Wed, 5 Sep 2018 08:32:02 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58794 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbeIEMcB (ORCPT ); Wed, 5 Sep 2018 08:32:01 -0400 Received: from p4fea45ac.dip0.t-ipconnect.de ([79.234.69.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fxSlo-00064p-BU; Wed, 05 Sep 2018 10:02:36 +0200 Date: Wed, 5 Sep 2018 10:02:35 +0200 (CEST) From: Thomas Gleixner To: "H. Peter Anvin" cc: "Kirill A. Shutemov" , Baoquan He , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, mingo@kernel.org, kirill.shutemov@linux.intel.com Subject: Re: [PATCH 1/3] x86/boot: Add bit fields into xloadflags for 5-level kernel checking In-Reply-To: <7a1147d7-05af-98fe-3a14-b18ea445c2b5@zytor.com> Message-ID: References: <20180829141624.13985-1-bhe@redhat.com> <20180829141624.13985-2-bhe@redhat.com> <6ea94875-ae07-6220-eb3e-d3f830cdac03@zytor.com> <20180904034414.GI1740@192.168.1.3> <4546fc39-4982-4c91-c812-0df1e9bc9e20@zytor.com> <20180904052036.GJ1740@192.168.1.3> <20180904084231.ubyjaqp4xhqcnper@kshutemo-mobl1> <7a1147d7-05af-98fe-3a14-b18ea445c2b5@zytor.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Sep 2018, H. Peter Anvin wrote: > On 09/04/18 01:42, Kirill A. Shutemov wrote: > > > > Switching between 4- and 5-level paging modes (in either direction) > > requires paing disabling. It means the code that does the switching has to > > be under 4G otherwise we would lose control. > > > > We handle the switching correctly in kernel decompression code, but not on > > kexec caller side. > > > > XLF_5LEVEL indicates that kernel decompression code can deal with > > switching between paging modes and it's safe to jump there in 5-level > > paging mode. > > > > As an alternative we can change kexec to switch to 4-level paging mode > > before starting the new kernel. Not sure how hard it will be. > > > > Have a flag saying entering in 5-level mode is fine. However, you really > should support returning to 4-level mode in kexec. It is *much* easier to do > on the caller side as you have total control of memory allocation there. Works for a regular kexec, but not for starting a crash kernel.... Thanks, tglx