]> git.baikalelectronics.ru Git - kernel.git/commit
firmware/efi: Tell memblock about EFI iomem reservations
authorMarc Zyngier <maz@kernel.org>
Tue, 13 Jul 2021 18:43:26 +0000 (19:43 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 16 Jul 2021 16:05:49 +0000 (18:05 +0200)
commit4a4701c9c097aaded1c1ae0e2388e314361d4b02
treef9a500115f1d2e1bca8452575eacc4eddb0576b0
parent2606ca12f95b9ec9a4c10aa7afadb8180d4d04ba
firmware/efi: Tell memblock about EFI iomem reservations

kexec_load_file() relies on the memblock infrastructure to avoid
stamping over regions of memory that are essential to the survival
of the system.

However, nobody seems to agree how to flag these regions as reserved,
and (for example) EFI only publishes its reservations in /proc/iomem
for the benefit of the traditional, userspace based kexec tool.

On arm64 platforms with GICv3, this can result in the payload being
placed at the location of the LPI tables. Shock, horror!

Let's augment the EFI reservation code with a memblock_reserve() call,
protecting our dear tables from the secondary kernel invasion.

Reported-by: Moritz Fischer <mdf@kernel.org>
Tested-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/efi.c