This is a note to let you know that I've just added the patch titled

    Revert "x86, efi: Retain boot service code until after switching to virtual 
mode"

to the 2.6.39-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     
revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch
and it can be found in the queue-2.6.39 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 3960a0761b9c0c7a15984d43c38573bb2c1a0c36 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>

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 <[email protected]> for reporting the
issue.

Cc: Maarten Lankhorst <[email protected]>
Cc: Jim Bos <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Yinghai Lu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 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;
 
 /**


Patches currently in stable-queue which might be from [email protected] are

queue-2.6.39/ath9k-reset-chip-on-baseband-hang.patch
queue-2.6.39/exec-delay-address-limit-change-until-point-of-no-return.patch
queue-2.6.39/ubifs-fix-memory-leak-on-error-path.patch
queue-2.6.39/option-add-alcatel-x200-to-sendsetup-blacklist.patch
queue-2.6.39/xen-off-by-one-errors-in-multicalls.c.patch
queue-2.6.39/lguest-fix-timer-interrupt-setup.patch
queue-2.6.39/option-add-zoom-4597-modem-usb-ids.patch
queue-2.6.39/iwl4965-fix-5ghz-operation.patch
queue-2.6.39/ubifs-fix-shrinker-object-count-reports.patch
queue-2.6.39/hwmon-coretemp-fix-tjmax-detection-for-older-cpus.patch
queue-2.6.39/pci-set-pcie-maxpayload-for-card-during-hotplug-insertion.patch
queue-2.6.39/intel-iommu-dont-cache-iova-above-32bit.patch
queue-2.6.39/powerpc-4xx-fix-regression-in-smp-on-476.patch
queue-2.6.39/ath9k-set-40-mhz-rate-only-if-hw-is-configured-in-ht40.patch
queue-2.6.39/x86-amd-iommu-fix-3-possible-endless-loops.patch
queue-2.6.39/usb-option-add-blacklist-for-zte-k3765-z-19d2-2002.patch
queue-2.6.39/block-export-blk_-get-put-_queue.patch
queue-2.6.39/cifs-silence-printk-when-establishing-first-session-on.patch
queue-2.6.39/nl80211-fix-check-for-valid-ssid-size-in-scan-operations.patch
queue-2.6.39/fat-fix-corrupt-inode-flags-when-remove-attr_sys-flag.patch
queue-2.6.39/usbnet-cdc_ncm-add-missing-.reset_resume-hook.patch
queue-2.6.39/serial-core-remove-uart_update_termios.patch
queue-2.6.39/arch-tile-allocate-pci-irqs-later-in-boot.patch
queue-2.6.39/serial-core-move-termios-handling-to-uart_startup.patch
queue-2.6.39/genirq-fix-descriptor-init-on-non-sparse-irqs.patch
queue-2.6.39/intel-iommu-use-coherent-dma-mask-when-requested.patch
queue-2.6.39/intel-iommu-only-unlink-device-domains-from-iommu.patch
queue-2.6.39/asus-wmi-remove-__init-from-asus_wmi_platform_init.patch
queue-2.6.39/hwmon-coretemp-relax-target-temperature-range-check.patch
queue-2.6.39/x86-amd-iommu-use-only-per-device-dma_ops.patch
queue-2.6.39/media-fix-media-device-minor-registration.patch
queue-2.6.39/powerpc-fix-32-bit-smp-build.patch
queue-2.6.39/video-fix-use-after-free-by-vga16fb-on-rmmod.patch
queue-2.6.39/drm-radeon-kms-fix-for-radeon-on-systems-4gb-without.patch
queue-2.6.39/fix-oops-caused-by-queue-refcounting-failure.patch
queue-2.6.39/intel-iommu-speed-up-processing-of-the-identity_mapping.patch
queue-2.6.39/iwl4965-correctly-validate-temperature-value.patch
queue-2.6.39/mm-fix-enospc-returned-by-handle_mm_fault.patch
queue-2.6.39/usb-storage-redo-incorrect-reads.patch
queue-2.6.39/revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch
queue-2.6.39/intel-iommu-add-domain-check-in-domain_remove_one_dev_info.patch
queue-2.6.39/drm-radeon-kms-viewport-height-has-to-be-even.patch
queue-2.6.39/zd1211rw-fix-to-work-on-ohci.patch
queue-2.6.39/lockdep-fix-lock_is_held-on-recursion.patch
queue-2.6.39/drm-i915-add-a-no-lvds-quirk-for-the-asus-eeebox-pc-eb1007.patch
queue-2.6.39/intel-iommu-flush-unmaps-at-domain_exit.patch
queue-2.6.39/usb-cdc-acm-adding-second-acm-channel-support-for-nokia-e7.patch
queue-2.6.39/x86-amd-iommu-fix-boot-crash-with-hidden-pci-devices.patch
queue-2.6.39/nbd-limit-module-parameters-to-a-sane-value.patch
queue-2.6.39/usb-core-tolerate-protocol-stall-during-hub-and-port.patch
queue-2.6.39/staging-gma500-get-control-from-firmware-framebuffer-if.patch
queue-2.6.39/intel-iommu-remove-host-bridge-devices-from-identity.patch
queue-2.6.39/ath9k-fix-two-more-bugs-in-tx-power.patch
queue-2.6.39/revert-usb-option-add-id-for-zte-mf-330.patch
queue-2.6.39/block-blkdev_get-should-access-bd_disk-only-after.patch
queue-2.6.39/usb-serial-add-another-4n-galaxy.de-pid-to-ftdi_sio-driver.patch
queue-2.6.39/option-add-prolink-ph300-modem-ids.patch
queue-2.6.39/intel-iommu-check-for-identity-mapping-candidate-using.patch
queue-2.6.39/serial-core-do-not-set-dtr-rts-twice-on-startup.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to