efi/libstub/arm*: Pass latest memory map to the kernel
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 24 Dec 2016 13:59:23 +0000 (13:59 +0000)
committerIngo Molnar <mingo@kernel.org>
Wed, 28 Dec 2016 08:23:32 +0000 (09:23 +0100)
commitabfb7b686a3e5be27bf81db62f9c5c895b76f5d1
treee2aa96d0faf8bd1bc7ba7c94c152d7b4a8ceb6ef
parent2d706e790f0508dff4fb72eca9b4892b79757feb
efi/libstub/arm*: Pass latest memory map to the kernel

As reported by James Morse, the current libstub code involving the
annotated memory map only works somewhat correctly by accident, due
to the fact that a pool allocation happens to be reused immediately,
retaining its former contents on most implementations of the
UEFI boot services.

Instead of juggling memory maps, which makes the code more complex than
it needs to be, simply put placeholder values into the FDT for the memory
map parameters, and only write the actual values after ExitBootServices()
has been called.

Reported-by: James Morse <james.morse@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: <stable@vger.kernel.org>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
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-arm-kernel@lists.infradead.org
Cc: linux-efi@vger.kernel.org
Fixes: ed9cc156c42f ("efi/libstub: Use efi_exit_boot_services() in FDT")
Link: http://lkml.kernel.org/r/1482587963-20183-2-git-send-email-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/libstub/efistub.h
drivers/firmware/efi/libstub/fdt.c