efi/arm32-stub: Allow boot-time allocations in the vmlinux region
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 4 Apr 2017 16:02:44 +0000 (17:02 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 5 Apr 2017 10:27:26 +0000 (12:27 +0200)
commit318532bf63cfab779d763527d8b93e48c4a96dba
tree2735a08e61a774de174fbae21e11df8bc8f1d9c9
parentb1d1776139698d7522dfd46aa81a056f030ddaf7
efi/arm32-stub: Allow boot-time allocations in the vmlinux region

The arm32 kernel decompresses itself to the base of DRAM unconditionally,
and so it is the EFI stub's job to ensure that the region is available.

Currently, we do this by creating an allocation there, and giving up if
that fails. However, any boot services regions occupying this area are
not an issue, given that the decompressor executes strictly after the
stub calls ExitBootServices().

So let's try a bit harder to proceed if the initial allocation fails,
and check whether any memory map entries occupying the region may be
considered safe.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Roy Franz <roy.franz@cavium.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20170404160245.27812-11-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/libstub/arm32-stub.c