Skip to content

Commit

Permalink
UEFI: Don't pass boot services regions to SetVirtualAddressMap()
Browse files Browse the repository at this point in the history
We need to map boot services regions during startup in order to avoid
firmware bugs, but we shouldn't be passing those regions to
SetVirtualAddressMap(). Ensure that we're only passing regions that are
marked as being mapped at runtime.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
Matthew Garrett authored and Matt Fleming committed Jun 6, 2013
1 parent f722406 commit 1acba98
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/x86/platform/efi/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,13 @@ void __init efi_enter_virtual_mode(void)
va = efi_ioremap(md->phys_addr, size,
md->type, md->attribute);

if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
if (!va)
pr_err("ioremap of 0x%llX failed!\n",
(unsigned long long)md->phys_addr);
continue;
}

md->virt_addr = (u64) (unsigned long) va;

if (!va) {
Expand Down

0 comments on commit 1acba98

Please sign in to comment.