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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 928bf837040a..70b2a3a305d6 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -416,8 +416,8 @@ void __init efi_reserve_boot_services(void)
416 * - Not within any part of the kernel 416 * - Not within any part of the kernel
417 * - Not the bios reserved area 417 * - Not the bios reserved area
418 */ 418 */
419 if ((start+size >= virt_to_phys(_text) 419 if ((start+size >= __pa_symbol(_text)
420 && start <= virt_to_phys(_end)) || 420 && start <= __pa_symbol(_end)) ||
421 !e820_all_mapped(start, start+size, E820_RAM) || 421 !e820_all_mapped(start, start+size, E820_RAM) ||
422 memblock_is_region_reserved(start, size)) { 422 memblock_is_region_reserved(start, size)) {
423 /* Could not reserve, skip it */ 423 /* Could not reserve, skip it */
@@ -843,7 +843,7 @@ void __init efi_enter_virtual_mode(void)
843 efi_memory_desc_t *md, *prev_md = NULL; 843 efi_memory_desc_t *md, *prev_md = NULL;
844 efi_status_t status; 844 efi_status_t status;
845 unsigned long size; 845 unsigned long size;
846 u64 end, systab, end_pfn; 846 u64 end, systab, start_pfn, end_pfn;
847 void *p, *va, *new_memmap = NULL; 847 void *p, *va, *new_memmap = NULL;
848 int count = 0; 848 int count = 0;
849 849
@@ -896,10 +896,9 @@ void __init efi_enter_virtual_mode(void)
896 size = md->num_pages << EFI_PAGE_SHIFT; 896 size = md->num_pages << EFI_PAGE_SHIFT;
897 end = md->phys_addr + size; 897 end = md->phys_addr + size;
898 898
899 start_pfn = PFN_DOWN(md->phys_addr);
899 end_pfn = PFN_UP(end); 900 end_pfn = PFN_UP(end);
900 if (end_pfn <= max_low_pfn_mapped 901 if (pfn_range_is_mapped(start_pfn, end_pfn)) {
901 || (end_pfn > (1UL << (32 - PAGE_SHIFT))
902 && end_pfn <= max_pfn_mapped)) {
903 va = __va(md->phys_addr); 902 va = __va(md->phys_addr);
904 903
905 if (!(md->attribute & EFI_MEMORY_WB)) 904 if (!(md->attribute & EFI_MEMORY_WB))