]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/platform/efi/efi_64.c
x86/efi: Consolidate region mapping logic
[mirror_ubuntu-artful-kernel.git] / arch / x86 / platform / efi / efi_64.c
index 677e29e294732560e2a1e66edbaa57a94b5d5cd9..45434ea345e97b77f76bc48bff1cfa3d078ef4cf 100644 (file)
@@ -214,7 +214,6 @@ void efi_sync_low_kernel_mappings(void)
 int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
 {
        unsigned long pfn, text;
-       efi_memory_desc_t *md;
        struct page *page;
        unsigned npages;
        pgd_t *pgd;
@@ -248,25 +247,6 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
        if (!IS_ENABLED(CONFIG_EFI_MIXED))
                return 0;
 
-       /*
-        * Map all of RAM so that we can access arguments in the 1:1
-        * mapping when making EFI runtime calls.
-        */
-       for_each_efi_memory_desc(md) {
-               if (md->type != EFI_CONVENTIONAL_MEMORY &&
-                   md->type != EFI_LOADER_DATA &&
-                   md->type != EFI_LOADER_CODE)
-                       continue;
-
-               pfn = md->phys_addr >> PAGE_SHIFT;
-               npages = md->num_pages;
-
-               if (kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, npages, _PAGE_RW)) {
-                       pr_err("Failed to map 1:1 memory\n");
-                       return 1;
-               }
-       }
-
        page = alloc_page(GFP_KERNEL|__GFP_DMA32);
        if (!page)
                panic("Unable to allocate EFI runtime stack < 4GB\n");