]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'x86-vmware-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Oct 2010 20:53:24 +0000 (13:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Oct 2010 20:53:24 +0000 (13:53 -0700)
* 'x86-vmware-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, paravirt: Remove alloc_pmd_clone hook, only used by VMI
  x86, vmware: Remove deprecated VMI kernel support

Fix up trivial #include conflict in arch/x86/kernel/smpboot.c

1  2 
Documentation/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/kernel/Makefile
arch/x86/kernel/setup.c
arch/x86/kernel/smpboot.c
arch/x86/mm/pgtable.c

index a2ffd6be0ef79374ed6d90773f77f288fc04103e,582409801a41801a2b6b47c054080c710f44c59e..3a0009e03d14bae7d9f6ccbf242675b92ce38c26
@@@ -455,7 -455,7 +455,7 @@@ and is between 256 and 4096 characters
                        [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
                                pxa_timer,timer3,32k_counter,timer0_1
                        [AVR32] avr32
-                       [X86-32] pit,hpet,tsc,vmi-timer;
+                       [X86-32] pit,hpet,tsc;
                                scx200_hrt on Geode; cyclone on IBM x440
                        [MIPS] MIPS
                        [PARISC] cr16
                force   Enable ASPM even on devices that claim not to support it.
                        WARNING: Forcing ASPM on may cause system lockups.
  
 +      pcie_ports=     [PCIE] PCIe ports handling:
 +              auto    Ask the BIOS whether or not to use native PCIe services
 +                      associated with PCIe ports (PME, hot-plug, AER).  Use
 +                      them only if that is allowed by the BIOS.
 +              native  Use native PCIe services associated with PCIe ports
 +                      unconditionally.
 +              compat  Treat PCIe ports as PCI-to-PCI bridges, disable the PCIe
 +                      ports driver.
 +
        pcie_pme=       [PCIE,PM] Native PCIe PME signaling options:
 -                      Format: {auto|force}[,nomsi]
 -              auto    Use native PCIe PME signaling if the BIOS allows the
 -                      kernel to control PCIe config registers of root ports.
 -              force   Use native PCIe PME signaling even if the BIOS refuses
 -                      to allow the kernel to control the relevant PCIe config
 -                      registers.
                nomsi   Do not use MSI for native PCIe PME signaling (this makes
 -                      all PCIe root ports use INTx for everything).
 +                      all PCIe root ports use INTx for all services).
  
        pcmv=           [HW,PCMCIA] BadgePAD 4
  
                        Reserves a hole at the top of the kernel virtual
                        address space.
  
 +      reservelow=     [X86]
 +                      Format: nn[K]
 +                      Set the amount of memory to reserve for BIOS at
 +                      the bottom of the address space.
 +
        reset_devices   [KNL] Force drivers to reset the underlying device
                        during initialization.
  
                        disables clocksource verification at runtime.
                        Used to enable high-resolution timer mode on older
                        hardware, and in virtualized environment.
 +                      [x86] noirqtime: Do not use TSC to do irq accounting.
 +                      Used to run time disable IRQ_TIME_ACCOUNTING on any
 +                      platforms where RDTSC is slow and this accounting
 +                      can add overhead.
  
        turbografx.map[2|3]=    [HW,JOY]
                        TurboGraFX parallel port interface
                        aux-ide-disks -- unplug non-primary-master IDE devices
                        nics -- unplug network devices
                        all -- unplug all emulated devices (NICs and IDE disks)
 -                      ignore -- continue loading the Xen platform PCI driver even
 -                              if the version check failed
 +                      unnecessary -- unplugging emulated devices is
 +                              unnecessary even if the host did not respond to
 +                              the unplug protocol
 +                      never -- do not unplug even if version check succeeds
  
        xirc2ps_cs=     [NET,PCMCIA]
                        Format:
diff --combined arch/x86/Kconfig
index 8a86a1e6825b197d262fe472fd3030e9634ecbea,f0ee331feeab4ad7816e51850990504e37d901cc..8c9e609a175b1d91865176ac0d2ce5d5a2fb0034
@@@ -25,7 -25,6 +25,7 @@@ config X8
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_PERF_EVENTS if (!M386 && !M486)
 +      select HAVE_IRQ_WORK
        select HAVE_IOREMAP_PROT
        select HAVE_KPROBES
        select ARCH_WANT_OPTIONAL_GPIOLIB
@@@ -34,7 -33,6 +34,7 @@@
        select HAVE_KRETPROBES
        select HAVE_OPTPROBES
        select HAVE_FTRACE_MCOUNT_RECORD
 +      select HAVE_C_RECORDMCOUNT
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_GRAPH_TRACER
@@@ -61,8 -59,6 +61,8 @@@
        select ANON_INODES
        select HAVE_ARCH_KMEMCHECK
        select HAVE_USER_RETURN_NOTIFIER
 +      select HAVE_ARCH_JUMP_LABEL
 +      select HAVE_TEXT_POKE_SMP
  
  config INSTRUCTION_DECODER
        def_bool (KPROBES || PERF_EVENTS)
@@@ -521,25 -517,6 +521,6 @@@ if PARAVIRT_GUES
  
  source "arch/x86/xen/Kconfig"
  
- config VMI
-       bool "VMI Guest support (DEPRECATED)"
-       select PARAVIRT
-       depends on X86_32
-       ---help---
-         VMI provides a paravirtualized interface to the VMware ESX server
-         (it could be used by other hypervisors in theory too, but is not
-         at the moment), by linking the kernel to a GPL-ed ROM module
-         provided by the hypervisor.
-         As of September 2009, VMware has started a phased retirement
-         of this feature from VMware's products. Please see
-         feature-removal-schedule.txt for details.  If you are
-         planning to enable this option, please note that you cannot
-         live migrate a VMI enabled VM to a future VMware product,
-         which doesn't support VMI. So if you expect your kernel to
-         seamlessly migrate to newer VMware products, keep this
-         disabled.
  config KVM_CLOCK
        bool "KVM paravirtualized clock"
        select PARAVIRT
@@@ -674,7 -651,7 +655,7 @@@ config GART_IOMM
        bool "GART IOMMU support" if EMBEDDED
        default y
        select SWIOTLB
 -      depends on X86_64 && PCI && K8_NB
 +      depends on X86_64 && PCI && AMD_NB
        ---help---
          Support for full DMA access of devices with 32bit memory access only
          on systems with more than 3GB. This is usually needed for USB,
@@@ -799,17 -776,6 +780,17 @@@ config SCHED_M
          making when dealing with multi-core CPU chips at a cost of slightly
          increased overhead in some places. If unsure say N here.
  
 +config IRQ_TIME_ACCOUNTING
 +      bool "Fine granularity task level IRQ time accounting"
 +      default n
 +      ---help---
 +        Select this option to enable fine granularity task irq time
 +        accounting. This is done by reading a timestamp on each
 +        transitions between softirq and hardirq state, so there can be a
 +        small performance impact.
 +
 +        If in doubt, say N here.
 +
  source "kernel/Kconfig.preempt"
  
  config X86_UP_APIC
@@@ -1163,9 -1129,6 +1144,9 @@@ config X86_PA
  config ARCH_PHYS_ADDR_T_64BIT
        def_bool X86_64 || X86_PAE
  
 +config ARCH_DMA_ADDR_T_64BIT
 +      def_bool X86_64 || HIGHMEM64G
 +
  config DIRECT_GBPAGES
        bool "Enable 1GB pages for kernel pagetables" if EMBEDDED
        default y
@@@ -1344,34 -1307,25 +1325,34 @@@ config X86_BOOTPARAM_MEMORY_CORRUPTION_
          Set whether the default state of memory_corruption_check is
          on or off.
  
 -config X86_RESERVE_LOW_64K
 -      bool "Reserve low 64K of RAM on AMI/Phoenix BIOSen"
 -      default y
 +config X86_RESERVE_LOW
 +      int "Amount of low memory, in kilobytes, to reserve for the BIOS"
 +      default 64
 +      range 4 640
        ---help---
 -        Reserve the first 64K of physical RAM on BIOSes that are known
 -        to potentially corrupt that memory range. A numbers of BIOSes are
 -        known to utilize this area during suspend/resume, so it must not
 -        be used by the kernel.
 +        Specify the amount of low memory to reserve for the BIOS.
 +
 +        The first page contains BIOS data structures that the kernel
 +        must not use, so that page must always be reserved.
  
 -        Set this to N if you are absolutely sure that you trust the BIOS
 -        to get all its memory reservations and usages right.
 +        By default we reserve the first 64K of physical RAM, as a
 +        number of BIOSes are known to corrupt that memory range
 +        during events such as suspend/resume or monitor cable
 +        insertion, so it must not be used by the kernel.
  
 -        If you have doubts about the BIOS (e.g. suspend/resume does not
 -        work or there's kernel crashes after certain hardware hotplug
 -        events) and it's not AMI or Phoenix, then you might want to enable
 -        X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check typical
 -        corruption patterns.
 +        You can set this to 4 if you are absolutely sure that you
 +        trust the BIOS to get all its memory reservations and usages
 +        right.  If you know your BIOS have problems beyond the
 +        default 64K area, you can set this to 640 to avoid using the
 +        entire low memory range.
  
 -        Say Y if unsure.
 +        If you have doubts about the BIOS (e.g. suspend/resume does
 +        not work or there's kernel crashes after certain hardware
 +        hotplug events) then you might want to enable
 +        X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check
 +        typical corruption patterns.
 +
 +        Leave this to the default value of 64 if you are unsure.
  
  config MATH_EMULATION
        bool
@@@ -1927,7 -1881,7 +1908,7 @@@ config PCI_GODIREC
        bool "Direct"
  
  config PCI_GOOLPC
 -      bool "OLPC"
 +      bool "OLPC XO-1"
        depends on OLPC
  
  config PCI_GOANY
@@@ -2088,21 -2042,14 +2069,21 @@@ config SCx200HR_TIME
  config OLPC
        bool "One Laptop Per Child support"
        select GPIOLIB
 +      select OLPC_OPENFIRMWARE
        ---help---
          Add support for detecting the unique features of the OLPC
          XO hardware.
  
 +config OLPC_XO1
 +      tristate "OLPC XO-1 support"
 +      depends on OLPC && PCI
 +      ---help---
 +        Add support for non-essential features of the OLPC XO-1 laptop.
 +
  config OLPC_OPENFIRMWARE
        bool "Support for OLPC's Open Firmware"
        depends on !X86_64 && !X86_PAE
 -      default y if OLPC
 +      default n
        help
          This option adds support for the implementation of Open Firmware
          that is used on the OLPC XO-1 Children's Machine.
  
  endif # X86_32
  
 -config K8_NB
 +config AMD_NB
        def_bool y
        depends on CPU_SUP_AMD && PCI
  
@@@ -2159,10 -2106,6 +2140,10 @@@ config HAVE_ATOMIC_IOMA
        def_bool y
        depends on X86_32
  
 +config HAVE_TEXT_POKE_SMP
 +      bool
 +      select STOP_MACHINE if SMP
 +
  source "net/Kconfig"
  
  source "drivers/Kconfig"
diff --combined arch/x86/kernel/Makefile
index 3323c6404035eec081ed13773535884f5cbf20ae,801127cd97542edcabd77cc483bf877b7494694d..80a93dc99076c3732a620b2f51a5560369ff3cb0
@@@ -11,8 -11,6 +11,8 @@@ ifdef CONFIG_FUNCTION_TRACE
  CFLAGS_REMOVE_tsc.o = -pg
  CFLAGS_REMOVE_rtc.o = -pg
  CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
 +CFLAGS_REMOVE_pvclock.o = -pg
 +CFLAGS_REMOVE_kvmclock.o = -pg
  CFLAGS_REMOVE_ftrace.o = -pg
  CFLAGS_REMOVE_early_printk.o = -pg
  endif
@@@ -34,8 -32,7 +34,8 @@@ GCOV_PROFILE_paravirt.o               := 
  obj-y                 := process_$(BITS).o signal.o entry_$(BITS).o
  obj-y                 += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
  obj-y                 += time.o ioport.o ldt.o dumpstack.o
 -obj-y                 += setup.o x86_init.o i8259.o irqinit.o
 +obj-y                 += setup.o x86_init.o i8259.o irqinit.o jump_label.o
 +obj-$(CONFIG_IRQ_WORK)  += irq_work.o
  obj-$(CONFIG_X86_VISWS)       += visws_quirks.o
  obj-$(CONFIG_X86_32)  += probe_roms_32.o
  obj-$(CONFIG_X86_32)  += sys_i386_32.o i386_ksyms_32.o
@@@ -86,16 -83,14 +86,15 @@@ obj-$(CONFIG_DOUBLEFAULT)  += doublefau
  obj-$(CONFIG_KGDB)            += kgdb.o
  obj-$(CONFIG_VM86)            += vm86_32.o
  obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
 +obj-$(CONFIG_EARLY_PRINTK_MRST)       += early_printk_mrst.o
  
  obj-$(CONFIG_HPET_TIMER)      += hpet.o
  obj-$(CONFIG_APB_TIMER)               += apb_timer.o
  
 -obj-$(CONFIG_K8_NB)           += k8.o
 +obj-$(CONFIG_AMD_NB)          += amd_nb.o
  obj-$(CONFIG_DEBUG_RODATA_TEST)       += test_rodata.o
  obj-$(CONFIG_DEBUG_NX_TEST)   += test_nx.o
  
- obj-$(CONFIG_VMI)             += vmi_32.o vmiclock_32.o
  obj-$(CONFIG_KVM_GUEST)               += kvm.o
  obj-$(CONFIG_KVM_CLOCK)               += kvmclock.o
  obj-$(CONFIG_PARAVIRT)                += paravirt.o paravirt_patch_$(BITS).o
@@@ -108,7 -103,6 +107,7 @@@ obj-$(CONFIG_SCx200)               += scx200.
  scx200-y                      += scx200_32.o
  
  obj-$(CONFIG_OLPC)            += olpc.o
 +obj-$(CONFIG_OLPC_XO1)                += olpc-xo1.o
  obj-$(CONFIG_OLPC_OPENFIRMWARE)       += olpc_ofw.o
  obj-$(CONFIG_X86_MRST)                += mrst.o
  
@@@ -125,6 -119,7 +124,6 @@@ obj-$(CONFIG_SWIOTLB)                      += pci-swiotlb.
  # 64 bit specific files
  ifeq ($(CONFIG_X86_64),y)
        obj-$(CONFIG_X86_UV)            += tlb_uv.o bios_uv.o uv_irq.o uv_sysfs.o uv_time.o
 -      obj-$(CONFIG_X86_PM_TIMER)      += pmtimer_64.o
        obj-$(CONFIG_AUDIT)             += audit_64.o
  
        obj-$(CONFIG_GART_IOMMU)        += pci-gart_64.o aperture_64.o
diff --combined arch/x86/kernel/setup.c
index 9e5cdaf73b4887461a32f7203c73d8d9656fbabc,feb4c21e499a0aaed5206acbc0dfb7f661b704b7..a59f6a6df5e25d104651bbeaf7202b8063f205bd
@@@ -83,7 -83,6 +83,6 @@@
  #include <asm/dmi.h>
  #include <asm/io_apic.h>
  #include <asm/ist.h>
- #include <asm/vmi.h>
  #include <asm/setup_arch.h>
  #include <asm/bios_ebda.h>
  #include <asm/cacheflush.h>
  #include <asm/percpu.h>
  #include <asm/topology.h>
  #include <asm/apicdef.h>
 -#include <asm/k8.h>
 +#include <asm/amd_nb.h>
  #ifdef CONFIG_X86_64
  #include <asm/numa_64.h>
  #endif
  #include <asm/mce.h>
 +#include <asm/alternative.h>
  
  /*
   * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries.
@@@ -126,6 -124,7 +125,6 @@@ unsigned long max_pfn_mapped
  RESERVE_BRK(dmi_alloc, 65536);
  #endif
  
 -unsigned int boot_cpu_id __read_mostly;
  
  static __initdata unsigned long _brk_start = (unsigned long)__brk_base;
  unsigned long _brk_end = (unsigned long)__brk_base;
@@@ -618,7 -617,79 +617,7 @@@ static __init void reserve_ibft_region(
                reserve_early_overlap_ok(addr, addr + size, "ibft");
  }
  
 -#ifdef CONFIG_X86_RESERVE_LOW_64K
 -static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
 -{
 -      printk(KERN_NOTICE
 -              "%s detected: BIOS may corrupt low RAM, working around it.\n",
 -              d->ident);
 -
 -      e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED);
 -      sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 -
 -      return 0;
 -}
 -#endif
 -
 -/* List of systems that have known low memory corruption BIOS problems */
 -static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
 -#ifdef CONFIG_X86_RESERVE_LOW_64K
 -      {
 -              .callback = dmi_low_memory_corruption,
 -              .ident = "AMI BIOS",
 -              .matches = {
 -                      DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
 -              },
 -      },
 -      {
 -              .callback = dmi_low_memory_corruption,
 -              .ident = "Phoenix BIOS",
 -              .matches = {
 -                      DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
 -              },
 -      },
 -      {
 -              .callback = dmi_low_memory_corruption,
 -              .ident = "Phoenix/MSC BIOS",
 -              .matches = {
 -                      DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix/MSC"),
 -              },
 -      },
 -      /*
 -       * AMI BIOS with low memory corruption was found on Intel DG45ID and
 -       * DG45FC boards.
 -       * It has a different DMI_BIOS_VENDOR = "Intel Corp.", for now we will
 -       * match only DMI_BOARD_NAME and see if there is more bad products
 -       * with this vendor.
 -       */
 -      {
 -              .callback = dmi_low_memory_corruption,
 -              .ident = "AMI BIOS",
 -              .matches = {
 -                      DMI_MATCH(DMI_BOARD_NAME, "DG45ID"),
 -              },
 -      },
 -      {
 -              .callback = dmi_low_memory_corruption,
 -              .ident = "AMI BIOS",
 -              .matches = {
 -                      DMI_MATCH(DMI_BOARD_NAME, "DG45FC"),
 -              },
 -      },
 -      /*
 -       * The Dell Inspiron Mini 1012 has DMI_BIOS_VENDOR = "Dell Inc.", so
 -       * match on the product name.
 -       */
 -      {
 -              .callback = dmi_low_memory_corruption,
 -              .ident = "Phoenix BIOS",
 -              .matches = {
 -                      DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
 -              },
 -      },
 -#endif
 -      {}
 -};
 +static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;
  
  static void __init trim_bios_range(void)
  {
         * A special case is the first 4Kb of memory;
         * This is a BIOS owned area, not kernel ram, but generally
         * not listed as such in the E820 table.
 +       *
 +       * This typically reserves additional memory (64KiB by default)
 +       * since some BIOSes are known to corrupt low memory.  See the
 +       * Kconfig help text for X86_RESERVE_LOW.
         */
 -      e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED);
 +      e820_update_range(0, ALIGN(reserve_low, PAGE_SIZE),
 +                        E820_RAM, E820_RESERVED);
 +
        /*
         * special case: Some BIOSen report the PC BIOS
         * area (640->1Mb) as ram even though it is not.
        sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
  }
  
 +static int __init parse_reservelow(char *p)
 +{
 +      unsigned long long size;
 +
 +      if (!p)
 +              return -EINVAL;
 +
 +      size = memparse(p, &p);
 +
 +      if (size < 4096)
 +              size = 4096;
 +
 +      if (size > 640*1024)
 +              size = 640*1024;
 +
 +      reserve_low = size;
 +
 +      return 0;
 +}
 +
 +early_param("reservelow", parse_reservelow);
 +
  /*
   * Determine if we were loaded by an EFI loader.  If so, then we have also been
   * passed the efi memmap, systab, etc., so we should use these data structures
@@@ -682,7 -725,6 +681,7 @@@ void __init setup_arch(char **cmdline_p
  {
        int acpi = 0;
        int k8 = 0;
 +      unsigned long flags;
  
  #ifdef CONFIG_X86_32
        memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
        printk(KERN_INFO "Command line: %s\n", boot_command_line);
  #endif
  
-       /* VMI may relocate the fixmap; do this before touching ioremap area */
-       vmi_init();
-       /* OFW also may relocate the fixmap */
+       /*
+        * If we have OLPC OFW, we might end up relocating the fixmap due to
+        * reserve_top(), so do this before touching the ioremap area.
+        */
        olpc_ofw_detect();
  
        early_trap_init();
  
        x86_report_nx();
  
-       /* Must be before kernel pagetables are setup */
-       vmi_activate();
        /* after early param, so could get panic from serial */
        reserve_early_setup_data();
  
  
        dmi_scan_machine();
  
 -      dmi_check_system(bad_bios_dmi_table);
 -
        /*
         * VMware detection requires dmi to be available, so this
         * needs to be done after dmi_scan_machine, for the BP.
        x86_init.oem.banner();
  
        mcheck_init();
 +
 +      local_irq_save(flags);
 +      arch_init_ideal_nop5();
 +      local_irq_restore(flags);
  }
  
  #ifdef CONFIG_X86_32
index 0116552c950db2b7f1e07dc5d1a27baf41b081e1,63a1a5596ac0aabbb1c90d8f4d31c9be65d9e76b..a3df9f8300375c7b7bef68d5ccd715d98cc9a2fc
@@@ -62,8 -62,6 +62,7 @@@
  #include <asm/pgtable.h>
  #include <asm/tlbflush.h>
  #include <asm/mtrr.h>
- #include <asm/vmi.h>
 +#include <asm/mwait.h>
  #include <asm/apic.h>
  #include <asm/setup.h>
  #include <asm/uv/uv.h>
@@@ -312,7 -310,6 +311,6 @@@ notrace static void __cpuinit start_sec
        __flush_tlb_all();
  #endif
  
-       vmi_bringup();
        cpu_init();
        preempt_disable();
        smp_callin();
@@@ -398,19 -395,6 +396,19 @@@ void __cpuinit smp_store_cpu_info(int i
                identify_secondary_cpu(c);
  }
  
 +static void __cpuinit link_thread_siblings(int cpu1, int cpu2)
 +{
 +      struct cpuinfo_x86 *c1 = &cpu_data(cpu1);
 +      struct cpuinfo_x86 *c2 = &cpu_data(cpu2);
 +
 +      cpumask_set_cpu(cpu1, cpu_sibling_mask(cpu2));
 +      cpumask_set_cpu(cpu2, cpu_sibling_mask(cpu1));
 +      cpumask_set_cpu(cpu1, cpu_core_mask(cpu2));
 +      cpumask_set_cpu(cpu2, cpu_core_mask(cpu1));
 +      cpumask_set_cpu(cpu1, c2->llc_shared_map);
 +      cpumask_set_cpu(cpu2, c1->llc_shared_map);
 +}
 +
  
  void __cpuinit set_cpu_sibling_map(int cpu)
  {
                for_each_cpu(i, cpu_sibling_setup_mask) {
                        struct cpuinfo_x86 *o = &cpu_data(i);
  
 -                      if (c->phys_proc_id == o->phys_proc_id &&
 -                          c->cpu_core_id == o->cpu_core_id) {
 -                              cpumask_set_cpu(i, cpu_sibling_mask(cpu));
 -                              cpumask_set_cpu(cpu, cpu_sibling_mask(i));
 -                              cpumask_set_cpu(i, cpu_core_mask(cpu));
 -                              cpumask_set_cpu(cpu, cpu_core_mask(i));
 -                              cpumask_set_cpu(i, c->llc_shared_map);
 -                              cpumask_set_cpu(cpu, o->llc_shared_map);
 +                      if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
 +                              if (c->phys_proc_id == o->phys_proc_id &&
 +                                  c->compute_unit_id == o->compute_unit_id)
 +                                      link_thread_siblings(cpu, i);
 +                      } else if (c->phys_proc_id == o->phys_proc_id &&
 +                                 c->cpu_core_id == o->cpu_core_id) {
 +                              link_thread_siblings(cpu, i);
                        }
                }
        } else {
@@@ -1396,88 -1381,11 +1394,88 @@@ void play_dead_common(void
        local_irq_disable();
  }
  
 +/*
 + * We need to flush the caches before going to sleep, lest we have
 + * dirty data in our caches when we come back up.
 + */
 +static inline void mwait_play_dead(void)
 +{
 +      unsigned int eax, ebx, ecx, edx;
 +      unsigned int highest_cstate = 0;
 +      unsigned int highest_subcstate = 0;
 +      int i;
 +      void *mwait_ptr;
 +
 +      if (!cpu_has(&current_cpu_data, X86_FEATURE_MWAIT))
 +              return;
 +      if (!cpu_has(&current_cpu_data, X86_FEATURE_CLFLSH))
 +              return;
 +      if (current_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
 +              return;
 +
 +      eax = CPUID_MWAIT_LEAF;
 +      ecx = 0;
 +      native_cpuid(&eax, &ebx, &ecx, &edx);
 +
 +      /*
 +       * eax will be 0 if EDX enumeration is not valid.
 +       * Initialized below to cstate, sub_cstate value when EDX is valid.
 +       */
 +      if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED)) {
 +              eax = 0;
 +      } else {
 +              edx >>= MWAIT_SUBSTATE_SIZE;
 +              for (i = 0; i < 7 && edx; i++, edx >>= MWAIT_SUBSTATE_SIZE) {
 +                      if (edx & MWAIT_SUBSTATE_MASK) {
 +                              highest_cstate = i;
 +                              highest_subcstate = edx & MWAIT_SUBSTATE_MASK;
 +                      }
 +              }
 +              eax = (highest_cstate << MWAIT_SUBSTATE_SIZE) |
 +                      (highest_subcstate - 1);
 +      }
 +
 +      /*
 +       * This should be a memory location in a cache line which is
 +       * unlikely to be touched by other processors.  The actual
 +       * content is immaterial as it is not actually modified in any way.
 +       */
 +      mwait_ptr = &current_thread_info()->flags;
 +
 +      wbinvd();
 +
 +      while (1) {
 +              /*
 +               * The CLFLUSH is a workaround for erratum AAI65 for
 +               * the Xeon 7400 series.  It's not clear it is actually
 +               * needed, but it should be harmless in either case.
 +               * The WBINVD is insufficient due to the spurious-wakeup
 +               * case where we return around the loop.
 +               */
 +              clflush(mwait_ptr);
 +              __monitor(mwait_ptr, 0, 0);
 +              mb();
 +              __mwait(eax, 0);
 +      }
 +}
 +
 +static inline void hlt_play_dead(void)
 +{
 +      if (current_cpu_data.x86 >= 4)
 +              wbinvd();
 +
 +      while (1) {
 +              native_halt();
 +      }
 +}
 +
  void native_play_dead(void)
  {
        play_dead_common();
        tboot_shutdown(TB_SHUTDOWN_WFS);
 -      wbinvd_halt();
 +
 +      mwait_play_dead();      /* Only returns on failure */
 +      hlt_play_dead();
  }
  
  #else /* ... !CONFIG_HOTPLUG_CPU */
diff --combined arch/x86/mm/pgtable.c
index c70e57dbb4912aea623654023a27e95721eec9a1,a96023e872aef534a9b7f0a762489929b526986d..8be8c7d7bc89759a55059ea440af5b26e3d9e0c9
@@@ -87,19 -87,7 +87,19 @@@ static inline void pgd_list_del(pgd_t *
  #define UNSHARED_PTRS_PER_PGD                         \
        (SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
  
 -static void pgd_ctor(pgd_t *pgd)
 +
 +static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
 +{
 +      BUILD_BUG_ON(sizeof(virt_to_page(pgd)->index) < sizeof(mm));
 +      virt_to_page(pgd)->index = (pgoff_t)mm;
 +}
 +
 +struct mm_struct *pgd_page_get_mm(struct page *page)
 +{
 +      return (struct mm_struct *)page->index;
 +}
 +
 +static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
  {
        /* If the pgd points to a shared pagetable level (either the
           ptes in non-PAE, or shared PMD in PAE), then just copy the
                clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY,
                                swapper_pg_dir + KERNEL_PGD_BOUNDARY,
                                KERNEL_PGD_PTRS);
-               paravirt_alloc_pmd_clone(__pa(pgd) >> PAGE_SHIFT,
-                                        __pa(swapper_pg_dir) >> PAGE_SHIFT,
-                                        KERNEL_PGD_BOUNDARY,
-                                        KERNEL_PGD_PTRS);
        }
  
        /* list required to sync kernel mapping updates */
 -      if (!SHARED_KERNEL_PMD)
 +      if (!SHARED_KERNEL_PMD) {
 +              pgd_set_mm(pgd, mm);
                pgd_list_add(pgd);
 +      }
  }
  
  static void pgd_dtor(pgd_t *pgd)
@@@ -286,7 -268,7 +282,7 @@@ pgd_t *pgd_alloc(struct mm_struct *mm
         */
        spin_lock_irqsave(&pgd_lock, flags);
  
 -      pgd_ctor(pgd);
 +      pgd_ctor(mm, pgd);
        pgd_prepopulate_pmd(mm, pgd, pmds);
  
        spin_unlock_irqrestore(&pgd_lock, flags);