linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Scott Ashcroft <scott.ashcroft@talk21.com>
Cc: Ingo Molnar <mingo@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Borislav Petkov <bp@alien8.de>,
	Ben Hutchings <ben@decadent.org.uk>,
	Raphael Hertzog <hertzog@debian.org>,
	Roger Shimizu <rogershimizu@gmail.com>,
	Alexis Murzeau <amurzeau@gmail.com>
Subject: Re: [PATCH] x86/efi: Always map boot service regions into new EFI page tables
Date: Sun, 13 Mar 2016 23:07:36 +0000	[thread overview]
Message-ID: <20160313230736.GB2619@codeblueprint.co.uk> (raw)
In-Reply-To: <20160313215847.GA2619@codeblueprint.co.uk>

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)));
 

  reply	other threads:[~2016-03-13 23:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 11:19 [GIT PULL] EFI urgent fix for v4.6 queue Matt Fleming
2016-03-11 11:19 ` [PATCH] x86/efi: Always map boot service regions into new EFI page tables Matt Fleming
2016-03-12 18:57   ` [tip:x86/urgent] x86/efi: Fix boot crash by always mapping " tip-bot for Matt Fleming
2016-03-12 23:02     ` Matt Fleming
2016-03-13 17:56       ` Ingo Molnar
2016-03-13 17:09   ` [PATCH] x86/efi: Always map " Scott Ashcroft
2016-03-13 21:58     ` Matt Fleming
2016-03-13 23:07       ` Matt Fleming [this message]
2016-03-13 23:44         ` Scott Ashcroft
2016-03-14  1:09         ` Scott Ashcroft
2016-03-14 10:30         ` Ingo Molnar
2016-03-14 11:35           ` Matt Fleming
2016-03-14 12:05             ` Ingo Molnar
2016-03-14 14:27               ` Matt Fleming
2016-03-14 16:47                 ` Ingo Molnar
2016-03-15 15:54                   ` Matt Fleming
2016-03-15 16:05                     ` Borislav Petkov
2016-03-15 16:25                     ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160313230736.GB2619@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=amurzeau@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ben@decadent.org.uk \
    --cc=bp@alien8.de \
    --cc=hertzog@debian.org \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mingo@kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rogershimizu@gmail.com \
    --cc=scott.ashcroft@talk21.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).