summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-06-10 17:08:56 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-10 17:08:56 -0700
commit3417628e56c4df8cec782913d52c9a1e7d5f6da3 (patch)
treec73957682ce5286d0cff9be679cfcd96436162c4
parent0168f76f1d812a6aee5a636d36d35014c645bec5 (diff)
downloadstable-queue-3417628e56c4df8cec782913d52c9a1e7d5f6da3.tar.gz
.39 patches
-rw-r--r--queue-2.6.39/revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch140
-rw-r--r--queue-2.6.39/series1
2 files changed, 141 insertions, 0 deletions
diff --git a/queue-2.6.39/revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch b/queue-2.6.39/revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch
new file mode 100644
index 0000000000..20a1e9f741
--- /dev/null
+++ b/queue-2.6.39/revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch
@@ -0,0 +1,140 @@
+From 3960a0761b9c0c7a15984d43c38573bb2c1a0c36 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Fri, 10 Jun 2011 16:49:10 -0700
+Subject: Revert "x86, efi: Retain boot service code until after switching to virtual mode"
+
+From: Greg Kroah-Hartman <gregkh@suse.de>
+
+This reverts commit 0aed459e8487eb6ebdb4efe8cefe1eafbc704b30, which was
+commit 916f676f8dc016103f983c7ec54c18ecdbb6e349 upstream.
+
+It breaks some people's machines, so this will all get worked out in the
+3.0 kernel release, it's not quite ready for 2.6.39 just yet.
+
+Thanks to Maarten Lankhorst <m.b.lankhorst@gmail.com> for reporting the
+issue.
+
+Cc: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+Cc: Jim Bos <jim876@xs4all.nl>
+Cc: Matthew Garrett <mjg@redhat.com>
+Cc: H. Peter Anvin <hpa@linux.intel.com>
+Cc: Tony Luck <tony.luck@intel.com>
+Cc: Yinghai Lu <yinghai@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ arch/x86/kernel/setup.c | 7 ------
+ arch/x86/platform/efi/efi.c | 45 -----------------------------------------
+ arch/x86/platform/efi/efi_64.c | 5 +---
+ include/linux/efi.h | 1
+ 4 files changed, 3 insertions(+), 55 deletions(-)
+
+--- a/arch/x86/kernel/setup.c
++++ b/arch/x86/kernel/setup.c
+@@ -912,13 +912,6 @@ void __init setup_arch(char **cmdline_p)
+ memblock.current_limit = get_max_mapped();
+ memblock_x86_fill();
+
+- /*
+- * The EFI specification says that boot service code won't be called
+- * after ExitBootServices(). This is, in fact, a lie.
+- */
+- if (efi_enabled)
+- efi_reserve_boot_services();
+-
+ /* preallocate 4k for mptable mpc */
+ early_reserve_e820_mpc_new();
+
+--- a/arch/x86/platform/efi/efi.c
++++ b/arch/x86/platform/efi/efi.c
+@@ -315,40 +315,6 @@ static void __init print_efi_memmap(void
+ }
+ #endif /* EFI_DEBUG */
+
+-void __init efi_reserve_boot_services(void)
+-{
+- void *p;
+-
+- for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+- efi_memory_desc_t *md = p;
+- 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)
+- continue;
+-
+- memblock_x86_reserve_range(start, start + size, "EFI Boot");
+- }
+-}
+-
+-static void __init efi_free_boot_services(void)
+-{
+- void *p;
+-
+- for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+- efi_memory_desc_t *md = p;
+- 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)
+- continue;
+-
+- free_bootmem_late(start, size);
+- }
+-}
+-
+ void __init efi_init(void)
+ {
+ efi_config_table_t *config_tables;
+@@ -541,9 +507,7 @@ void __init efi_enter_virtual_mode(void)
+ efi.systab = NULL;
+ for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+ md = p;
+- if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
+- md->type != EFI_BOOT_SERVICES_CODE &&
+- md->type != EFI_BOOT_SERVICES_DATA)
++ if (!(md->attribute & EFI_MEMORY_RUNTIME))
+ continue;
+
+ size = md->num_pages << EFI_PAGE_SHIFT;
+@@ -594,13 +558,6 @@ void __init efi_enter_virtual_mode(void)
+ }
+
+ /*
+- * Thankfully, it does seem that no runtime services other than
+- * SetVirtualAddressMap() will touch boot services code, so we can
+- * get rid of it all at this point
+- */
+- efi_free_boot_services();
+-
+- /*
+ * Now that EFI is in virtual mode, update the function
+ * pointers in the runtime service table to the new virtual addresses.
+ *
+--- a/arch/x86/platform/efi/efi_64.c
++++ b/arch/x86/platform/efi/efi_64.c
+@@ -64,11 +64,10 @@ static void __init early_runtime_code_ma
+ if (!(__supported_pte_mask & _PAGE_NX))
+ return;
+
+- /* Make EFI service code area executable */
++ /* Make EFI runtime service code area executable */
+ for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+ md = p;
+- if (md->type == EFI_RUNTIME_SERVICES_CODE ||
+- md->type == EFI_BOOT_SERVICES_CODE) {
++ if (md->type == EFI_RUNTIME_SERVICES_CODE) {
+ unsigned long end;
+ end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
+ early_mapping_set_exec(md->phys_addr, end, executable);
+--- a/include/linux/efi.h
++++ b/include/linux/efi.h
+@@ -299,7 +299,6 @@ extern void efi_initialize_iomem_resourc
+ struct resource *data_resource, struct resource *bss_resource);
+ extern unsigned long efi_get_time(void);
+ extern int efi_set_rtc_mmss(unsigned long nowtime);
+-extern void efi_reserve_boot_services(void);
+ extern struct efi_memory_map memmap;
+
+ /**
diff --git a/queue-2.6.39/series b/queue-2.6.39/series
index 7f6cad8507..9b4fab4956 100644
--- a/queue-2.6.39/series
+++ b/queue-2.6.39/series
@@ -56,3 +56,4 @@ revert-usb-option-add-id-for-zte-mf-330.patch
usb-core-tolerate-protocol-stall-during-hub-and-port.patch
usb-serial-add-another-4n-galaxy.de-pid-to-ftdi_sio-driver.patch
usb-storage-redo-incorrect-reads.patch
+revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch