From: "Jan Beulich" Subject: Re: [PATCH RFC] EFI: allow retry of ExitBootServices() call Date: Mon, 17 Nov 2014 13:35:17 +0000 Message-ID: <546A07A502000078000486D0@mail.emea.novell.com> References: <5466059A0200007800047A4B@mail.emea.novell.com> <20141114153208.GD5364@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XqMSh-0003UT-8V for xen-devel@lists.xenproject.org; Mon, 17 Nov 2014 13:35:23 +0000 In-Reply-To: <20141114153208.GD5364@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 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? And for the LIST_POISON* override one? Jan