From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932853AbcHVQlG (ORCPT ); Mon, 22 Aug 2016 12:41:06 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34234 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752762AbcHVQlF (ORCPT ); Mon, 22 Aug 2016 12:41:05 -0400 Date: Mon, 22 Aug 2016 18:41:00 +0200 From: Ingo Molnar To: Matt Fleming Cc: Thomas Gleixner , "H . Peter Anvin" , Jeffrey Hugo , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Leif Lindholm , Mark Rutland , stable@vger.kernel.org Subject: Re: [PATCH 3/6] efi/libstub: Introduce ExitBootServices helper Message-ID: <20160822164100.GB11327@gmail.com> References: <1471638904-3494-1-git-send-email-matt@codeblueprint.co.uk> <1471638904-3494-4-git-send-email-matt@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471638904-3494-4-git-send-email-matt@codeblueprint.co.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Matt Fleming wrote: > From: Jeffrey Hugo > > The spec allows ExitBootServices to fail with EFI_INVALID_PARAMETER if a > race condition has occurred where the EFI has updated the memory map after > the stub grabbed a reference to the map. The spec defines a retry > proceedure with specific requirements to handle this scenario. > > This scenario was previously observed on x86 - commit d3768d885c6c ("x86, > efi: retry ExitBootServices() on failure") but the current fix is not spec > compliant and the scenario is now observed on the Qualcomm Technologies > QDF2432 via the FDT stub which does not handle the error and thus causes > boot failures. It's unclear what this 'scenario' is. How does the user notice? > Add a helper to the stub library that correctly adhears to the spec in the > case of EFI_INVALID_PARAMETER from ExitBootServices and can be universally > used across all stub implementations. s/'adheres to' > + status = efi_call_early(exit_boot_services, handle, > + *map->key_ptr); Please don't add spurious linebreaks in such a case - just keep it a bit longer than col80. > + if (status != EFI_SUCCESS) > + /* exit_boot_services() was called, thus cannot free*/ > + goto fail; Non-standard comment format and comment placement. Thanks, Ingo