diff options
author | Borislav Petkov <bp@suse.de> | 2014-01-18 12:48:17 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-03-04 16:17:18 +0000 |
commit | b7b898ae0c0a82489511a1ce1b35f26215e6beb5 (patch) | |
tree | 79167e1a9fe59bf3e4b55772ccd294bf9cad2b11 /arch/x86/platform/efi/efi_32.c | |
parent | 42a5477251f0e0f33ad5f6a95c48d685ec03191e (diff) | |
download | op-kernel-dev-b7b898ae0c0a82489511a1ce1b35f26215e6beb5.zip op-kernel-dev-b7b898ae0c0a82489511a1ce1b35f26215e6beb5.tar.gz |
x86/efi: Make efi virtual runtime map passing more robust
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>
Diffstat (limited to 'arch/x86/platform/efi/efi_32.c')
-rw-r--r-- | arch/x86/platform/efi/efi_32.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index 39496ae..9ee3491 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c @@ -40,8 +40,12 @@ static unsigned long efi_rt_eflags; void efi_sync_low_kernel_mappings(void) {} -void efi_setup_page_tables(void) {} void __init efi_dump_pagetable(void) {} +int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) +{ + return 0; +} +void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) {} void __init efi_map_region(efi_memory_desc_t *md) { |