From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH V3 3/5] x86/efi: Permanently save the EFI_MEMORY_MAP passed by the firmware Date: Wed, 5 Sep 2018 14:56:45 +0200 Message-ID: <20180905125645.GX24082@hirez.programming.kicks-ass.net> References: <1536099149-12564-1-git-send-email-sai.praneeth.prakhya@intel.com> <1536099149-12564-4-git-send-email-sai.praneeth.prakhya@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Ard Biesheuvel Cc: Sai Praneeth Prakhya , linux-efi , Linux Kernel Mailing List , the arch/x86 maintainers , "Neri, Ricardo" , Matt Fleming , Al Stone , Borislav Petkov , Ingo Molnar , Andy Lutomirski , Bhupesh Sharma , Thomas Gleixner List-Id: linux-efi@vger.kernel.org On Wed, Sep 05, 2018 at 02:27:49PM +0200, Ard Biesheuvel wrote: > On 5 September 2018 at 00:12, Sai Praneeth Prakhya > wrote: > > From: Sai Praneeth > > > > The efi page fault handler that recovers from page faults caused by the > > firmware needs the original memory map passed by the firmware. It looks > > up this memory map to find the type of the memory region at which the > > page fault occurred. Presently, EFI subsystem discards the original > > memory map passed by the firmware and replaces it with a new memory map > > that has only EFI_RUNTIME_SERVICES_ regions. But illegal > > accesses by firmware can occur at any region. Hence, _only_ if > > CONFIG_EFI_WARN_ON_ILLEGAL_ACCESS is defined, create a backup of the > > original memory map passed by the firmware, so that efi page fault > > handler could detect/recover from illegal accesses to *any* efi region. > > > > Why do we care about the memory map at all when a fault occurs during > the invocation of a EFI runtime service? > > I think reasoning about what went wrong and why, and distinguishing > between allowable and non-allowable faults is a slippery slope, so > [taking Thomas's feedback into account], I think we can simplify this > series further and just block all subsequent EFI runtime services > calls if any permission or page fault occurs while executing them. > > Would we still need to preserve the old memory map in that case? I thought the reason for having this was being able to know the fault is in an EFI area. But of course, I'm not wel versed in this whole EFI crapola.