Commit 1acba98f authored by Matthew Garrett's avatar Matthew Garrett Committed by Matt Fleming

UEFI: Don't pass boot services regions to SetVirtualAddressMap()

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: default avatarMatthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent f722406f
...@@ -1026,6 +1026,13 @@ void __init efi_enter_virtual_mode(void) ...@@ -1026,6 +1026,13 @@ void __init efi_enter_virtual_mode(void)
va = efi_ioremap(md->phys_addr, size, va = efi_ioremap(md->phys_addr, size,
md->type, md->attribute); 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; md->virt_addr = (u64) (unsigned long) va;
if (!va) { if (!va) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment