]> git.baikalelectronics.ru Git - kernel.git/commit
efi/arm64: Fix fdt-related memory reservation
authorMark Salter <msalter@redhat.com>
Mon, 8 Sep 2014 17:01:08 +0000 (13:01 -0400)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 9 Sep 2014 06:51:09 +0000 (07:51 +0100)
commit7b357ed61c56af4bca3b55485b2829cb35743fa3
tree13c1130bd8946b473214ac173019e45809340727
parent5ca9645fab2bbf41df9832466f3113e4eb5ef297
efi/arm64: Fix fdt-related memory reservation

Commit 79b92823794c:
 "arm64: ignore DT memreserve entries when booting in UEFI mode

prevents early_init_fdt_scan_reserved_mem() from being called for
arm64 kernels booting via UEFI. This was done because the kernel
will use the UEFI memory map to determine reserved memory regions.
That approach has problems in that early_init_fdt_scan_reserved_mem()
also reserves the FDT itself and any node-specific reserved memory.
By chance of some kernel configs, the FDT may be overwritten before
it can be unflattened and the kernel will fail to boot. More subtle
problems will result if the FDT has node specific reserved memory
which is not really reserved.

This patch has the UEFI stub remove the memory reserve map entries
from the FDT as it does with the memory nodes. This allows
early_init_fdt_scan_reserved_mem() to be called unconditionally
so that the other needed reservations are made.

Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
arch/arm64/mm/init.c
drivers/firmware/efi/libstub/fdt.c