--- a/arch/x86/kernel/e820.c 2009-02-08 15:37:27.000000000 -0500 +++ b/arch/x86/kernel/e820.c 2009-02-28 07:20:09.000000000 -0500 @@ -51,6 +51,10 @@ unsigned long pci_mem_start = 0xaeedbabe EXPORT_SYMBOL(pci_mem_start); #endif +#ifdef CONFIG_EFI +extern int efi_enabled; +#endif + /* * This function checks if any part of the range is mapped * with type. @@ -1071,7 +1075,7 @@ static unsigned long __init e820_end_pfn unsigned long start_pfn; unsigned long end_pfn; - if (ei->type != type) + if (type && (ei->type != type)) continue; start_pfn = ei->addr >> PAGE_SHIFT; @@ -1096,7 +1100,12 @@ static unsigned long __init e820_end_pfn } unsigned long __init e820_end_of_ram_pfn(void) { - return e820_end_pfn(MAX_ARCH_PFN, E820_RAM); +#ifdef CONFIG_EFI + if (efi_enabled) + return e820_end_pfn(MAX_ARCH_PFN, NULL); + else +#endif + return e820_end_pfn(MAX_ARCH_PFN, E820_RAM); } unsigned long __init e820_end_of_low_ram_pfn(void)