aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/efi/efi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/platform/efi/efi.c')
-rw-r--r--arch/x86/platform/efi/efi.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index c9718a16be15..37718f0f053d 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -323,13 +323,10 @@ static void __init do_add_efi_memmap(void)
323 case EFI_UNUSABLE_MEMORY: 323 case EFI_UNUSABLE_MEMORY:
324 e820_type = E820_UNUSABLE; 324 e820_type = E820_UNUSABLE;
325 break; 325 break;
326 case EFI_RUNTIME_SERVICES_DATA:
327 e820_type = E820_RESERVED_EFI;
328 break;
329 default: 326 default:
330 /* 327 /*
331 * EFI_RESERVED_TYPE EFI_RUNTIME_SERVICES_CODE 328 * EFI_RESERVED_TYPE EFI_RUNTIME_SERVICES_CODE
332 * EFI_MEMORY_MAPPED_IO 329 * EFI_RUNTIME_SERVICES_DATA EFI_MEMORY_MAPPED_IO
333 * EFI_MEMORY_MAPPED_IO_PORT_SPACE EFI_PAL_CODE 330 * EFI_MEMORY_MAPPED_IO_PORT_SPACE EFI_PAL_CODE
334 */ 331 */
335 e820_type = E820_RESERVED; 332 e820_type = E820_RESERVED;
@@ -674,21 +671,10 @@ void __init efi_enter_virtual_mode(void)
674 end_pfn = PFN_UP(end); 671 end_pfn = PFN_UP(end);
675 if (end_pfn <= max_low_pfn_mapped 672 if (end_pfn <= max_low_pfn_mapped
676 || (end_pfn > (1UL << (32 - PAGE_SHIFT)) 673 || (end_pfn > (1UL << (32 - PAGE_SHIFT))
677 && end_pfn <= max_pfn_mapped)) { 674 && end_pfn <= max_pfn_mapped))
678 va = __va(md->phys_addr); 675 va = __va(md->phys_addr);
679 676 else
680 if (!(md->attribute & EFI_MEMORY_WB)) { 677 va = efi_ioremap(md->phys_addr, size, md->type);
681 addr = (u64) (unsigned long)va;
682 npages = md->num_pages;
683 memrange_efi_to_native(&addr, &npages);
684 set_memory_uc(addr, npages);
685 }
686 } else {
687 if (!(md->attribute & EFI_MEMORY_WB))
688 va = ioremap_nocache(md->phys_addr, size);
689 else
690 va = ioremap_cache(md->phys_addr, size);
691 }
692 678
693 md->virt_addr = (u64) (unsigned long) va; 679 md->virt_addr = (u64) (unsigned long) va;
694 680
@@ -698,6 +684,13 @@ void __init efi_enter_virtual_mode(void)
698 continue; 684 continue;
699 } 685 }
700 686
687 if (!(md->attribute & EFI_MEMORY_WB)) {
688 addr = md->virt_addr;
689 npages = md->num_pages;
690 memrange_efi_to_native(&addr, &npages);
691 set_memory_uc(addr, npages);
692 }
693
701 systab = (u64) (unsigned long) efi_phys.systab; 694 systab = (u64) (unsigned long) efi_phys.systab;
702 if (md->phys_addr <= systab && systab < end) { 695 if (md->phys_addr <= systab && systab < end) {
703 systab += md->virt_addr - md->phys_addr; 696 systab += md->virt_addr - md->phys_addr;