Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932808AbcCMXHu (ORCPT ); Sun, 13 Mar 2016 19:07:50 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38289 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754288AbcCMXHl (ORCPT ); Sun, 13 Mar 2016 19:07:41 -0400 Date: Sun, 13 Mar 2016 23:07:36 +0000 From: Matt Fleming To: Scott Ashcroft Cc: Ingo Molnar , "H . Peter Anvin" , Thomas Gleixner , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Maarten Lankhorst , Matthew Garrett , Borislav Petkov , Ben Hutchings , Raphael Hertzog , Roger Shimizu , Alexis Murzeau Subject: Re: [PATCH] x86/efi: Always map boot service regions into new EFI page tables Message-ID: <20160313230736.GB2619@codeblueprint.co.uk> References: <1457695163-29632-1-git-send-email-matt@codeblueprint.co.uk> <1457695163-29632-2-git-send-email-matt@codeblueprint.co.uk> <1457888975.3884.9.camel@talk21.com> <20160313215847.GA2619@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160313215847.GA2619@codeblueprint.co.uk> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1998 Lines: 47 On Sun, 13 Mar, at 09:58:47PM, Matt Fleming wrote: > (Fixing Maarten's email address which I botched originally) > > On Sun, 13 Mar, at 05:09:35PM, Scott Ashcroft wrote: > > On Fri, 2016-03-11 at 11:19 +0000, Matt Fleming wrote: > > > Some machines have EFI regions in page zero (physical address > > > 0x00000000) and historically that region has been added to the e820 > > > map via trim_bios_range(), and ultimately mapped into the kernel page > > > tables. It was not mapped via efi_map_regions() as one would expect. > > > > > > Alexis reports that with the new separate EFI page tables some boot > > > services regions, such as page zero, are not mapped. This triggers an > > > oops during the SetVirtualAddressMap() runtime call. > > > > > > I'm still seeing a failure to boot even with this patch. > > > > http://www.qzxyz.com/IMG_20160313_164601.jpgSorry for the dodgy photo but the screen has almost a mirror finish. > > > > Attached is the dmesg from 4.4 with efi=debug memblock=debug > > Well, crap. Can you enable CONFIG_EFI_PGT_DUMP and send the dmesg > because it would be good to know how things are mapped before this > patch. > > I'd be surprised if the issue you're seeing is related to the one that > Alexis reported. Having corrupt page table structures is a whole new > bag of scary. > > Does $(grep pdpe1gb /proc/cpuinfo) show any output on your machine? Assuming the answer to this question is "no", can you try out this patch? diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 8fee5b6f8f66..af74849e8c0f 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -1055,7 +1055,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd, /* * Map everything starting from the Gb boundary, possibly with 1G pages */ - while (end - start >= PUD_SIZE) { + while (cpu_has_gbpages && end - start >= PUD_SIZE) { set_pud(pud, __pud(cpa->pfn << PAGE_SHIFT | _PAGE_PSE | massage_pgprot(pud_pgprot)));