]> git.baikalelectronics.ru Git - kernel.git/commit
efi: libstub/arm: Account for firmware reserved memory at the base of RAM
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 29 Oct 2019 17:37:53 +0000 (18:37 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 31 Oct 2019 08:40:19 +0000 (09:40 +0100)
commit41cd96fa149b29684ebd38759fefb07f9c7d5276
treefce13b2d950718e2c44329cd6f6448cd6e4a65e0
parent18b915ac6b0ac5ba7ded03156860f60a9f16df2b
efi: libstub/arm: Account for firmware reserved memory at the base of RAM

The EFI stubloader for ARM starts out by allocating a 32 MB window
at the base of RAM, in order to ensure that the decompressor (which
blindly copies the uncompressed kernel into that window) does not
overwrite other allocations that are made while running in the context
of the EFI firmware.

In some cases, (e.g., U-Boot running on the Raspberry Pi 2), this is
causing boot failures because this initial allocation conflicts with
a page of reserved memory at the base of RAM that contains the SMP spin
tables and other pieces of firmware data and which was put there by
the bootloader under the assumption that the TEXT_OFFSET window right
below the kernel is only used partially during early boot, and will be
left alone once the memory reservations are processed and taken into
account.

So let's permit reserved memory regions to exist in the region starting
at the base of RAM, and ending at TEXT_OFFSET - 5 * PAGE_SIZE, which is
the window below the kernel that is not touched by the early boot code.

Tested-by: Guillaume Gardet <Guillaume.Gardet@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Chester Lin <clin@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20191029173755.27149-5-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/arm32-stub.c