Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2152243imm; Mon, 3 Sep 2018 21:16:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdalCZBrkca9v+L+97IxUCVtaeTODPLn3TyUBkg6DLFZyeRodiW/x+W38njua619CkFkMzBw X-Received: by 2002:a62:ad9:: with SMTP id 86-v6mr32975426pfk.57.1536034568817; Mon, 03 Sep 2018 21:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536034568; cv=none; d=google.com; s=arc-20160816; b=D07ezGFpiZ0XHBodnarFuRzXz5ue6FbpWdMVqLmfsMaKXzdt0MDPzT1cdVHCykppnK DeDpcC6IVYLEsYFNT7kbpL0/NakZIrXoTaj2jkQ6d04i4lErnGaJosR5fn0O1oGKjPAL gtoqAdDADzCk1edKNSK1KAKtuxFU8z0VjanTBMAdA1FdTsZMI+4zvXhJ3mtP0D4WCvpg CaTX+va4tQ43QpaNONXFgiQcrOHkn8xXpl8PYHe/4nS5JWZr3J48m2txlZKzAXm8m4R7 5JrO2fEAT46huf2iJ/Wr3D3tXINZcCSbVF3R3KMGB0JtM/FkgD+F+uDkHRv75nnkzwOc Vlqw== 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:arc-authentication-results; bh=//sG9qNyQFFSotCWHRuvOyDQC5qDDNMatQv2uZjgu9g=; b=wqW3N0lO9SVdjhEfwqnQnTKeNqiQSRuFv6ALFySeZNJESzHotuABtJTd/9y8hleEI/ 0jfQoHwZBEIeDdvyS6bS/h8dXlJhf7NEX38+O5UUZm8JDutGIFUakrRW1uDOiYQ6rgAh YXWMY8NYcy6KVI1XYQ3+1hsaC5GeX3mOwNvrOohblaveRWn2hr/83tTmI4hpbLYhipQA NXQB7SclKcRb09fyXErDBx+E7jY8KT0zpJQ3locskZuvUdpH70gFaM+Hx/tPQgjLQSbY tu9XWh1pNHFmbDfkRFrX/jWpW4tsTqZ4Pi6JSSl13/7dOYNO5jRsW9Y7mtuM7Gl0iRfr Z29g== 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 u22-v6si1539478plk.443.2018.09.03.21.15.53; Mon, 03 Sep 2018 21:16:08 -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 S1726487AbeIDIha (ORCPT + 99 others); Tue, 4 Sep 2018 04:37:30 -0400 Received: from terminus.zytor.com ([198.137.202.136]:57011 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbeIDIha (ORCPT ); Tue, 4 Sep 2018 04:37:30 -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 w844Dx8c3550253 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 3 Sep 2018 21:13:59 -0700 Subject: Re: [PATCH 1/3] x86/boot: Add bit fields into xloadflags for 5-level kernel checking To: Baoquan He Cc: tglx@linutronix.de, mingo@kernel.org, kirill.shutemov@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org 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> From: "H. Peter Anvin" Message-ID: <4546fc39-4982-4c91-c812-0df1e9bc9e20@zytor.com> Date: Mon, 3 Sep 2018 21:13:54 -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: <20180904034414.GI1740@192.168.1.3> 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/03/18 20:44, Baoquan He wrote: > > 1) in arch/x86/kernel/relocate_kernel_64.S, we set X86_CR4_LA57 into cr4 > if the 1st kernel is in 5-level mode. Then in > arch/x86/boot/compressed/head_64.S, paging_prepare() is called to decide > if 5-level mode will be enabled, and prepare the trampoline. If > kexec/kdump kernel is expected to be in 4-level, e.g with 'nolv5' > specified, it still can handle well. But for the old kernel w/o these > 5-level codes, it will ignore the fact that X86_CR4_LA57 has been set > in CR4 and proceed anyway, then #GP is triggered. That's why XLF_5LEVEL > is used to mark. > That's what I'm saying, don't do that. Always jump into the second kernel in 4-level mode, i.e. X86_CR4_LA57 unset. That's the only sane thing. -hpa