diff options
Diffstat (limited to 'arch/x86/kernel/efi.c')
-rw-r--r-- | arch/x86/kernel/efi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 1119d247fe11..eb1ef3b67dd5 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c | |||
@@ -467,7 +467,7 @@ void __init efi_enter_virtual_mode(void) | |||
467 | efi_memory_desc_t *md; | 467 | efi_memory_desc_t *md; |
468 | efi_status_t status; | 468 | efi_status_t status; |
469 | unsigned long size; | 469 | unsigned long size; |
470 | u64 end, systab, addr, npages; | 470 | u64 end, systab, addr, npages, end_pfn; |
471 | void *p, *va; | 471 | void *p, *va; |
472 | 472 | ||
473 | efi.systab = NULL; | 473 | efi.systab = NULL; |
@@ -479,7 +479,10 @@ void __init efi_enter_virtual_mode(void) | |||
479 | size = md->num_pages << EFI_PAGE_SHIFT; | 479 | size = md->num_pages << EFI_PAGE_SHIFT; |
480 | end = md->phys_addr + size; | 480 | end = md->phys_addr + size; |
481 | 481 | ||
482 | if (PFN_UP(end) <= max_low_pfn_mapped) | 482 | end_pfn = PFN_UP(end); |
483 | if (end_pfn <= max_low_pfn_mapped | ||
484 | || (end_pfn > (1UL << (32 - PAGE_SHIFT)) | ||
485 | && end_pfn <= max_pfn_mapped)) | ||
483 | va = __va(md->phys_addr); | 486 | va = __va(md->phys_addr); |
484 | else | 487 | else |
485 | va = efi_ioremap(md->phys_addr, size); | 488 | va = efi_ioremap(md->phys_addr, size); |