Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689Ab3IPQaL (ORCPT ); Mon, 16 Sep 2013 12:30:11 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:52533 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025Ab3IPQaH (ORCPT ); Mon, 16 Sep 2013 12:30:07 -0400 X-Originating-IP: 50.43.39.152 Date: Mon, 16 Sep 2013 09:29:54 -0700 From: Josh Triplett To: Laszlo Ersek Cc: Matt Fleming , jerry.hoemann@hp.com, Andrew Fish , edk2-devel@lists.sourceforge.net, linux-efi@vger.kernel.org, Gleb Natapov , lkml , David Woodhouse , Matthew Garrett , Brian Richardson , Colin Ian King , Randy Wright , Linn Crosetto , terry.lee@hp.com, samer.el-haj-mahmoud@hp.com, randy.pawell@hp.com, chrisp@hp.com, linda.knippers@hp.com, dong.wei@hp.com, "H. Peter Anvin" , Borislav Petkov , Chao Zhang , Yao Jiewen Subject: Re: [edk2] Corrupted EFI region Message-ID: <20130916162918.GA4555@leaf> References: <20130807151935.GJ17920@pd.tnic> <20130807201908.GG2515@console-pimps.org> <20130808101730.GJ2515@console-pimps.org> <20130913203812.GA312@anatevka.fc.hp.com> <20130916105920.GB2697@console-pimps.org> <5236F096.8040702@redhat.com> <20130916155751.GA3636@leaf> <523730F2.40408@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <523730F2.40408@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2590 Lines: 62 On Mon, Sep 16, 2013 at 06:25:22PM +0200, Laszlo Ersek wrote: > On 09/16/13 17:57, Josh Triplett wrote: > > >> The edk2 commit that flipped the memory type underneath the image data > >> from EfiReservedMemoryType to EfiBootServicesData is: > >> > >> https://github.com/tianocore/edk2/commit/4c58575e > >> > >> I think this commit is wrong. It's fine for OSPM to release the image > >> data at some point, but not right after ExitBootServices(), because > >> referencing pointers in ACPI tables survive strictly longer. > >> > >> ... Actually, the commit does follow the ACPI spec 5.0: > >> > >> 5.2.22.4 Image Address > >> > >> The Image Address contains the location in memory where an > >> in-memory copy of the boot image can be found. The image should be > >> stored in EfiBootServicesData, allowing the system to reclaim > >> the memory when the image is no longer needed. > >> > >> The ACPI spec 5.0 should recommend EfiACPIReclaimMemory here IMO. (I > >> take the current wording ("should be stored") as a recommendation only.) > > > > I agree that UEFI *should* store the BGRT in EfiACPIReclaimMemory, but > > in practice the UEFI firmware I've seen with a BGRT does follow that > > recommendation and store it in EfiBootServicesData. So, even if the > > recommendation in the spec changed, the kernel would still have to > > accomodate both possibilities. > > Just for the theoretical debate: > > The edk2 commit linked above is 5 days old. All UEFI firmware in the > wild (on released hardware) should be using EfiReservedMemoryType (the > pre-patch memory type), which is even stricter. > > EfiReservedMemoryType can never be released & repurposed, so it should > make no difference for crash kernel allocation, shouldn't it? > > - call efi_free_boot_services() -- doesn't touch the image data (which > is in RAM of EfiReservedMemoryType), > - reserve crash kernel, > - access BGRT via ACPI. > > BGRT had appeared in edk2 with > > https://github.com/tianocore/edk2/commit/0284e90c > > and EfiReservedMemoryType used to be the allocation type until commit > 4c58575e. > > Or are you alluding to UEFI firmware that's not based on TianoCore? I'm saying, in practice, that the systems I tested BGRT support on and submitted patches for stored the BGRT's image in EfiBootServicesData. - Josh Triplett -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/