]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
efi/libstub: Introduce ExitBootServices helper
authorJeffrey Hugo <jhugo@codeaurora.org>
Mon, 29 Aug 2016 20:38:52 +0000 (14:38 -0600)
committerMatt Fleming <matt@codeblueprint.co.uk>
Mon, 5 Sep 2016 11:32:28 +0000 (12:32 +0100)
commitfc07716ba803483be91bc4b2344f9c84985e6f07
tree67256f8edc0ddb23dc5f6be586c90ee01877a2a4
parentdadb57abc37499f565b23933dbf49b435c3ba8af
efi/libstub: Introduce ExitBootServices helper

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.  The user will notice the boot failure as the kernel is not
executed and the system may drop back to a UEFI shell, but will be
unresponsive to input and the system will require a power cycle to recover.

Add a helper to the stub library that correctly adheres to the spec in the
case of EFI_INVALID_PARAMETER from ExitBootServices and can be universally
used across all stub implementations.

Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
drivers/firmware/efi/libstub/efi-stub-helper.c
include/linux/efi.h