Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp434778imm; Wed, 26 Sep 2018 00:56:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV61SFUCzzazhJT0QJj6KdyY+GrgMwkUtpMovAyo/uD8Zg37pexfxnjNJC3h42GkjXy1gzkTR X-Received: by 2002:a17:902:1566:: with SMTP id b35-v6mr4806053plh.135.1537948606988; Wed, 26 Sep 2018 00:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537948606; cv=none; d=google.com; s=arc-20160816; b=1ChaNya87thJjeFmHSC7oihRRXF7MR3U+sX337y8hVRIyJkyVKgkMSZt2pTIP6P6F8 L1tXD4aOqBPg5VEx/IpKKn7SdfgpvhZAzNfUTZpD59GHzhrJg4ZXeJdUfx0Whl7ln3Cz FphWfKLzazfnSZyML2axuP/+FBBrCUX5ejP68BxQ+VSP8TYOY/BuOWWw7KbTeyD295hF peypgR4avJTM+hfTUjAAR56wPIxaxPfpMRY9WvQhzKdPZKSR1OzZ7C6b0PGndiMj93et 1VM5V5NZBUX2mvrxCNycKnhkqhBHNooC9/d0loGZeKduf/lbzlWBx57OvjJMIF2aGfX7 GHnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=T0wvNpA0Rgfk9kqHlGw07h2k9DzEoPRM7qdFd0b2FPs=; b=N9JggHLJYe/4LrRA8MAYmc8goQpHOcZagrlKEpHrwX6c2aA+o1syxx3l2Q+aNcOx5t p9AIH+rjwSwVlVjw3MEhP40uK68JZ8qAeIX8MqBsSiOET6lE0FrmSEPJ4nwulW/ndBpC HDIy0h1veC9GNfEccbMcQH/tLroKT3yhK/rHmAIBI+K9Enp+AyF2tzP0qAPcnpMWrNJZ TG60cciH+hOp82VP3INwXsBNPmK0Ym1785IzHZvDGjR8egkuqkq77+7Oqlq6TGGlJmvR lqjsUHwc5IfQOo4yreJKB/4lrbXguMTgUpxCTCw/75HnEaPv9Q7NeoEy7oWBVBdkp77B B1Xw== 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 h17-v6si4468553pgj.214.2018.09.26.00.56.32; Wed, 26 Sep 2018 00:56:46 -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 S1727351AbeIZOGP (ORCPT + 99 others); Wed, 26 Sep 2018 10:06:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10700 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbeIZOGP (ORCPT ); Wed, 26 Sep 2018 10:06:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 100F8C058CA5; Wed, 26 Sep 2018 07:54:37 +0000 (UTC) Received: from localhost (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 492B617ADC; Wed, 26 Sep 2018 07:54:35 +0000 (UTC) Date: Wed, 26 Sep 2018 15:54:33 +0800 From: Baoquan He To: Thomas Gleixner , mingo@kernel.org, "H. Peter Anvin" Cc: "Kirill A. Shutemov" , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com Subject: Re: [PATCH 1/3] x86/boot: Add bit fields into xloadflags for 5-level kernel checking Message-ID: <20180926075433.GD2555@MiWiFi-R3L-srv> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 26 Sep 2018 07:54:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/05/18 at 10:02am, Thomas Gleixner wrote: > 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.... Agree, it's not appropriate to do this after normal kernel crashed and prepare to jump to 2nd kernel. Can this patchset be merged? I will post patches to kexec-tools utility since it will make use of these flags. Thanks Baoquan