[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110613164712.GA23343@srcf.ucam.org>
Date: Mon, 13 Jun 2011 17:47:12 +0100
From: Matthew Garrett <mjg59@...f.ucam.org>
To: Maarten Lankhorst <m.b.lankhorst@...il.com>
Cc: Yinghai Lu <yinghai@...nel.org>, Jim Bos <jim876@...all.nl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg KH <gregkh@...e.de>,
"H. Peter Anvin" <hpa@...ux.intel.com>
Subject: Re: 2.6.39.1 immediately reboots/resets on EFI system
Ok, let's just try this in a somewhat more brute force way. Can you try
this patch on top of current git, and give me the full dmesg and
/proc/iomem ?
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 0d3a4fa..ffbe47c 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -312,11 +312,35 @@ void __init efi_reserve_boot_services(void)
efi_memory_desc_t *md = p;
unsigned long long start = md->phys_addr;
unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
+ unsigned long long end = start + size;
- if (md->type != EFI_BOOT_SERVICES_CODE &&
- md->type != EFI_BOOT_SERVICES_DATA)
+ if (md->type != EFI_BOOT_SERVICES_CODE)
continue;
+ /*
+ * Trying to map EFI code over the zero page is just asking
+ * for trouble. The good news is that it's almost certainly
+ * only there for graphics card bringup at POST time, so
+ * we should be able to get away with not having it there
+ */
+
+ if (start == 0) {
+ md->num_pages = 0;
+ continue;
+ }
+
+ /*
+ * We probably also want to avoid mapping code over the
+ * kernel...
+ */
+
+ if ((start <= virt_to_phys(_etext)-1 && end >= virt_to_phys(_text)) ||
+ (start <= virt_to_phys(_edata)-1 && end >= virt_to_phys(_etext)) ||
+ (start <= virt_to_phys(&__bss_stop)-1 && end >= virt_to_phys(&__bss_start))) {
+ md->num_pages = 0;
+ continue;
+ }
+
memblock_x86_reserve_range(start, start + size, "EFI Boot");
}
}
@@ -330,8 +354,10 @@ static void __init efi_free_boot_services(void)
unsigned long long start = md->phys_addr;
unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
- if (md->type != EFI_BOOT_SERVICES_CODE &&
- md->type != EFI_BOOT_SERVICES_DATA)
+ if (md->type != EFI_BOOT_SERVICES_CODE)
+ continue;
+
+ if (size == 0)
continue;
free_bootmem_late(start, size);
@@ -483,9 +509,6 @@ void __init efi_init(void)
x86_platform.set_wallclock = efi_set_rtc_mmss;
#endif
- /* Setup for EFI runtime service */
- reboot_type = BOOT_EFI;
-
#if EFI_DEBUG
print_efi_memmap();
#endif
--
Matthew Garrett | mjg59@...f.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists