From: "Jan Beulich" Subject: Re: [PATCH RFC] EFI: allow retry of ExitBootServices() call Date: Mon, 17 Nov 2014 13:57:46 +0000 Message-ID: <546A0CEA02000078000486FC@mail.emea.novell.com> References: <5466059A0200007800047A4B@mail.emea.novell.com> <20141114153208.GD5364@laptop.dumpdata.com> <546A07A502000078000486D0@mail.emea.novell.com> <20141117134939.GB16549@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XqMoP-0004JP-HM for xen-devel@lists.xenproject.org; Mon, 17 Nov 2014 13:57:49 +0000 In-Reply-To: <20141117134939.GB16549@laptop.dumpdata.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: roy.franz@linaro.org, xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 17.11.14 at 14:49, wrote: > On Mon, Nov 17, 2014 at 01:35:17PM +0000, Jan Beulich wrote: >> >>> On 14.11.14 at 16:32, wrote: >> > On Fri, Nov 14, 2014 at 12:37:30PM +0000, Jan Beulich wrote: >> >> The specification is kind of vague under what conditions >> >> ExitBootServices() may legitimately fail, requiring the OS loader to >> >> retry: >> >> >> >> "If MapKey value is incorrect, ExitBootServices() returns >> >> EFI_INVALID_PARAMETER and GetMemoryMap() with ExitBootServices() must >> >> be called again. Firmware implementation may choose to do a partial >> >> shutdown of the boot services during the first call to >> >> ExitBootServices(). EFI OS loader should not make calls to any boot >> >> service function other then GetMemoryMap() after the first call to >> >> ExitBootServices()." >> >> >> >> While our code guarantees the map key to be valid, there are systems >> >> where a firmware internal notification sent while processing >> >> ExitBootServices() reportedly results in changes to the memory map. >> > >> > s/reportedly/in fact/ >> >> In that case, make a best effort second try: Avoid any boot service >> >> calls other than the two named above, with the possible exception of >> >> error paths. Those aren't a problem, since if we end up needing to >> >> retry, we're hosed when something goes wrong as much as if we didn't >> >> make the retry attempt. >> >> >> >> For x86, a minimal adjustment to efi_arch_process_memory_map() is >> >> needed for it to cope with potentially being called a second time. >> > >> > Wow. Talk about timing. We saw this and were going to see >> > doing something similar. >> >> So what are your thoughts then regarding this patch going into 4.5? > > Definitly should go in - and I would even say backport to earlier > versions of Xen. Sure, backporting was planned anyway. Jan