From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753158AbdK3Ppf (ORCPT ); Thu, 30 Nov 2017 10:45:35 -0500 Received: from smtprelay0243.hostedemail.com ([216.40.44.243]:53209 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752130AbdK3Ppd (ORCPT ); Thu, 30 Nov 2017 10:45:33 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3167:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4560:5007:6742:7576:7875:7903:9545:10004:10400:10848:10967:11232:11473:11657:11658:11914:12043:12295:12438:12555:12740:12760:12895:12986:13095:13141:13230:13439:14181:14659:14721:21080:21433:21434:21451:21627:30012:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: cent31_6a086113aed05 X-Filterd-Recvd-Size: 3662 Message-ID: <1512056726.19952.100.camel@perches.com> Subject: Re: [PATCHv2 0/4] x86: 5-level related changes into decompression code From: Joe Perches To: "Kirill A. Shutemov" , Borislav Petkov Cc: "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Linus Torvalds , Andy Lutomirski , Cyrill Gorcunov , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Thu, 30 Nov 2017 07:45:26 -0800 In-Reply-To: <20171130073130.afualycggltkvl6s@black.fi.intel.com> References: <20171110220645.59944-1-kirill.shutemov@linux.intel.com> <20171129154908.6y4st6xc7hbsey2v@pd.tnic> <20171129161349.d7ksuhwhdamloty6@node.shutemov.name> <20171129170831.2iqpop2u534mgrbc@node.shutemov.name> <20171129174851.jk2ai37uumxve6sg@pd.tnic> <20171130073130.afualycggltkvl6s@black.fi.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-11-30 at 10:31 +0300, Kirill A. Shutemov wrote: > On Wed, Nov 29, 2017 at 05:48:51PM +0000, Borislav Petkov wrote: > > On Wed, Nov 29, 2017 at 08:08:31PM +0300, Kirill A. Shutemov wrote: > > > We're really early in the boot -- startup_64 in decompression code -- and > > > I don't know a way print a message there. Is there a way? > > > > > > no_longmode handled by just hanging the machine. Is it enough for no_la57 > > > case too? > > > > Patch pls. > > The patch below on top of patch 2/4 from this patch would do the trick. > > Please give it a shot. > > From 95b5489d1f4ea03c6226d13eb6797825234489d6 Mon Sep 17 00:00:00 2001 > From: "Kirill A. Shutemov" > Date: Thu, 30 Nov 2017 10:23:53 +0300 > Subject: [PATCH] x86/boot/compressed/64: Print error if 5-level paging is not > supported > > We cannot proceed booting if the machine doesn't support the paging mode > kernel was compiled for. > > Getting error the usual way -- via validate_cpu() -- is not going to > work. We need to enable appropriate paging mode before that, otherwise > kernel would triple-fault during KASLR setup. > > This code will go away once we get support for boot-time switching > between paging modes. trivia: > diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c [] > @@ -362,6 +364,13 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, > console_init(); > debug_putstr("early console in extract_kernel\n"); > > + if (IS_ENABLED(CONFIG_X86_5LEVEL) && !l5_paging_required()) { > + error("The kernel is compiled with 5-level paging enabled, " > + "but the CPU doesn't support la57\n" la57 is lanthanum, perhaps something less obscure or more readily searchable? Maybe cr4.la57? it? Maybe something like: "This linux kernel as configured requires 5-level paging\n" "This CPU does not support the required 'cr4.la57' feature\n" "Unable to boot - please use a kernel appropriate for your CPU\n" And please use complete coalesced single lines. > + "Unable to boot - please use " > + "a kernel appropriate for your CPU.\n"); Here too. Thanks.