Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3335481imm; Tue, 4 Sep 2018 21:08:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaMWjpPDN5UET/CqXmorvioNjUzDtpwVHbzil8pSFSw6FfJQWavqwfv4SmOWkIlGhOIo0Qn X-Received: by 2002:a63:65c2:: with SMTP id z185-v6mr34407734pgb.276.1536120534515; Tue, 04 Sep 2018 21:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536120534; cv=none; d=google.com; s=arc-20160816; b=A6nZ439Rn4m8zKuWpeJSWz0/DsCAw/SLpjSxGqtlEPg8rS6j0cg3O/2aQm1TKThC1s yq3Ljulydhhy21r4tHrq+KCdjS64YBJgnDyqSb7BEaZCFIpqUpk9F7UlURPiMxf3UrRa 1xVNtXFPMqPA+1zWPBY97iXogVi+AIbGMs6m/d7dZjsfxiDyLsW43b5qhVYtFaMGnKjz h4MSL24+cIp27UWDq3VlSDeaNqJn4U45GFqGMwlOJ6Ml7wtmHOF5JOxpxENI93BUHVOi QAZPukjFx5lbtoRFGAV9ceYb4MhuJLpB6+PcD4hWsRme0GebVfu+5L7TR1VAYlSv2cT4 0Hmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=2B7qbfQEdIBKCMxkw3NKJQAHuXn143X1kUJi3pJ4l/k=; b=U+bSk4SryIMHUIdRbPCAGl5XZk17x6zQ0hgWS/9Oaw2EwPIsRufUX2fKIG/nHN7ZnB xtgy+ycfUJyhYZC/TqkumnJWSa42Z7LmADkaHuUYOM0F8XaDjLaRowaePw5kGaidEpNN zkPEhCWECzWwD1lLHqeRhqYi2JVhndrV7Tb/UX9lIBcGgZ2FmK9QbP/Qq/7Mh5ObFGys bmywz1CAg+DGSrMKJjcSofj1N4h2igYKgTyx8JIm/WHO9uQdqnZ6XE2qI5Kce53SDRUD npT4N3PVhmLlih3eeydltVDgmW4XwDpuK+V005n8JSZkN0+NY2xAPb5tuGkMl8uRoeWM fHow== 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 h65-v6si841980pfg.197.2018.09.04.21.08.38; Tue, 04 Sep 2018 21:08:54 -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 S1727466AbeIEIfD (ORCPT + 99 others); Wed, 5 Sep 2018 04:35:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42243 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbeIEIfD (ORCPT ); Wed, 5 Sep 2018 04:35:03 -0400 Received: from carbon-x1.hos.anvin.org (c-24-5-245-234.hsd1.ca.comcast.net [24.5.245.234] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w8546CiW3934371 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 4 Sep 2018 21:06:12 -0700 Subject: Re: [PATCH 1/3] x86/boot: Add bit fields into xloadflags for 5-level kernel checking To: "Kirill A. Shutemov" Cc: Baoquan He , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, kirill.shutemov@linux.intel.com 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> From: "H. Peter Anvin" Message-ID: <7a1147d7-05af-98fe-3a14-b18ea445c2b5@zytor.com> Date: Tue, 4 Sep 2018 21:06:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180904084231.ubyjaqp4xhqcnper@kshutemo-mobl1> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -hpa