From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH RFC] EFI: allow retry of ExitBootServices() call Date: Mon, 17 Nov 2014 08:49:39 -0500 Message-ID: <20141117134939.GB16549@laptop.dumpdata.com> References: <5466059A0200007800047A4B@mail.emea.novell.com> <20141114153208.GD5364@laptop.dumpdata.com> <546A07A502000078000486D0@mail.emea.novell.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 1XqMgc-00040s-2a for xen-devel@lists.xenproject.org; Mon, 17 Nov 2014 13:49:46 +0000 Content-Disposition: inline In-Reply-To: <546A07A502000078000486D0@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: roy.franz@linaro.org, xen-devel List-Id: xen-devel@lists.xenproject.org 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. > And for the LIST_POISON* override one? Yes as well please. > > Jan >