Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
[safe/jmp/linux-2.6] / arch / x86 / xen / enlighten.c
index e2511bc..2b26dd5 100644 (file)
@@ -140,24 +140,23 @@ static void xen_vcpu_setup(int cpu)
  */
 void xen_vcpu_restore(void)
 {
-       if (have_vcpu_info_placement) {
-               int cpu;
+       int cpu;
 
-               for_each_online_cpu(cpu) {
-                       bool other_cpu = (cpu != smp_processor_id());
+       for_each_online_cpu(cpu) {
+               bool other_cpu = (cpu != smp_processor_id());
 
-                       if (other_cpu &&
-                           HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
-                               BUG();
+               if (other_cpu &&
+                   HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
+                       BUG();
 
-                       xen_vcpu_setup(cpu);
+               xen_setup_runstate_info(cpu);
 
-                       if (other_cpu &&
-                           HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
-                               BUG();
-               }
+               if (have_vcpu_info_placement)
+                       xen_vcpu_setup(cpu);
 
-               BUG_ON(!have_vcpu_info_placement);
+               if (other_cpu &&
+                   HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
+                       BUG();
        }
 }
 
@@ -180,6 +179,7 @@ static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
 static void xen_cpuid(unsigned int *ax, unsigned int *bx,
                      unsigned int *cx, unsigned int *dx)
 {
+       unsigned maskebx = ~0;
        unsigned maskecx = ~0;
        unsigned maskedx = ~0;
 
@@ -187,9 +187,16 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
         * Mask out inconvenient features, to try and disable as many
         * unsupported kernel subsystems as possible.
         */
-       if (*ax == 1) {
+       switch (*ax) {
+       case 1:
                maskecx = cpuid_leaf1_ecx_mask;
                maskedx = cpuid_leaf1_edx_mask;
+               break;
+
+       case 0xb:
+               /* Suppress extended topology stuff */
+               maskebx = 0;
+               break;
        }
 
        asm(XEN_EMULATE_PREFIX "cpuid"
@@ -199,6 +206,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
                  "=d" (*dx)
                : "0" (*ax), "2" (*cx));
 
+       *bx &= maskebx;
        *cx &= maskecx;
        *dx &= maskedx;
 }
@@ -1086,10 +1094,8 @@ asmlinkage void __init xen_start_kernel(void)
 
        __supported_pte_mask |= _PAGE_IOMAP;
 
-#ifdef CONFIG_X86_64
        /* Work out if we support NX */
-       check_efer();
-#endif
+       x86_configure_nx();
 
        xen_setup_features();
 
@@ -1179,6 +1185,8 @@ asmlinkage void __init xen_start_kernel(void)
 
        xen_raw_console_write("about to get started...\n");
 
+       xen_setup_runstate_info(0);
+
        /* Start the world */
 #ifdef CONFIG_X86_32
        i386_start_kernel();