From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com ([209.85.212.180]:38516 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbbI2OgP (ORCPT ); Tue, 29 Sep 2015 10:36:15 -0400 Received: by wiclk2 with SMTP id lk2so19165519wic.1 for ; Tue, 29 Sep 2015 07:36:14 -0700 (PDT) Date: Tue, 29 Sep 2015 15:36:12 +0100 From: Matt Fleming To: Borislav Petkov Cc: Ingo Molnar , Ard Biesheuvel , Thomas Gleixner , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , "linux-efi@vger.kernel.org" , Leif Lindholm , Catalin Marinas , Will Deacon , "stable@vger.kernel.org" , Matt Fleming , Mark Rutland , Mark Salter , Linus Torvalds , Andrew Morton , Andy Lutomirski , Denys Vlasenko , Brian Gerst Subject: Re: [PATCH 2/2] arm64/efi: Don't pad between EFI_MEMORY_RUNTIME regions Message-ID: <20150929143612.GC4401@codeblueprint.co.uk> References: <1443218539-7610-1-git-send-email-matt@codeblueprint.co.uk> <1443218539-7610-3-git-send-email-matt@codeblueprint.co.uk> <20150926060159.GB25877@gmail.com> <20150927070644.GC26125@gmail.com> <20150927104014.GA7631@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150927104014.GA7631@pd.tnic> Sender: stable-owner@vger.kernel.org List-ID: On Sun, 27 Sep, at 12:40:14PM, Borislav Petkov wrote: > On Sun, Sep 27, 2015 at 09:06:44AM +0200, Ingo Molnar wrote: > > Could we please re-list all the arguments pro and contra of 1:1 physical mappings, > > in a post that also explains the background so that more people can chime in, not > > just people versed in EFI internals? It's very much possible that a bad decision > > was made. > > The main reason why we did the additional, top-down mapping was kexec > kernel wanting to use UEFI runtime facilities too and the braindead > design of SetVirtualAddressMap() being callable only once per system > boot. So we had to have stable mappings which are valid in the kexec-ed > kernel too. > > But this was long time ago and I most certainly have forgotten all the > details. That's a pretty good summary for x86. I think specifically the reason we map the EFI memmap entries "backwards" (entry N has higher VA than entry N+1) is because the code was easier to write that way, but you'll know better than me ;-) > And now I'm wondering why didn't we do the 1:1 thing and rebuild the > exact same EFI pagetable in the kexec-ed kernel? Because when we do > an EFI call, we switch to the special pagetable so why didn't we make > the kexec-ed kernel rebuild the 1:1 pagetable which it can use for EFI > calls... > > Hmm, again, I've forgotten a lot of details so I'm sure Matt will come > in and say "No, you can't do that because..." I *think* the only reason was the Apple firmware problem where it explodes if you pass the 1:1 mappings to SetVirtualAddressMap(). And obviously people do want to use kexec with Apple machines. It's probably worth revisiting this whole thing from the x86 side. -- Matt Fleming, Intel Open Source Technology Center