linux/arch/x86/platform/efi
Borislav Petkov 579d8f085b x86/efi: Make efi virtual runtime map passing more robust
commit b7b898ae0c upstream.

Currently, running SetVirtualAddressMap() and passing the physical
address of the virtual map array was working only by a lucky coincidence
because the memory was present in the EFI page table too. Until Toshi
went and booted this on a big HP box - the krealloc() manner of resizing
the memmap we're doing did allocate from such physical addresses which
were not mapped anymore and boom:

http://lkml.kernel.org/r/1386806463.1791.295.camel@misato.fc.hp.com

One way to take care of that issue is to reimplement the krealloc thing
but with pages. We start with contiguous pages of order 1, i.e. 2 pages,
and when we deplete that memory (shouldn't happen all that often but you
know firmware) we realloc the next power-of-two pages.

Having the pages, it is much more handy and easy to map them into the
EFI page table with the already existing mapping code which we're using
for building the virtual mappings.

Thanks to Toshi Kani and Matt for the great debugging help.

Reported-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14 06:50:02 -07:00
..
Makefile x86/efi: Add EFI framebuffer earlyprintk support 2013-10-28 18:09:58 +00:00
early_printk.c x86/efi: Fix earlyprintk off-by-one bug 2013-11-28 20:16:56 +00:00
efi-bgrt.c x86/efi: Check status field to validate BGRT header 2014-02-14 10:07:15 +00:00
efi.c x86/efi: Make efi virtual runtime map passing more robust 2014-04-14 06:50:02 -07:00
efi_32.c x86/efi: Make efi virtual runtime map passing more robust 2014-04-14 06:50:02 -07:00
efi_64.c x86/efi: Make efi virtual runtime map passing more robust 2014-04-14 06:50:02 -07:00
efi_stub_32.S
efi_stub_64.S x86/efi: Runtime services virtual mapping 2013-11-02 11:09:36 +00:00