Revert "x86, apic: Use logical flat on intel with <= 8 logical cpus"
[safe/jmp/linux-2.6] / arch / x86 / kernel / apic / probe_64.c
index 70935dd..65edc18 100644 (file)
@@ -44,15 +44,27 @@ static struct apic *apic_probe[] __initdata = {
        NULL,
 };
 
+static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
+{
+       return hard_smp_processor_id() >> index_msb;
+}
+
 /*
  * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
  */
 void __init default_setup_apic_routing(void)
 {
 #ifdef CONFIG_X86_X2APIC
-       if (apic == &apic_x2apic_phys || apic == &apic_x2apic_cluster) {
-               if (!intr_remapping_enabled)
-                       apic = &apic_flat;
+       if (x2apic_mode
+#ifdef CONFIG_X86_UV
+                      && apic != &apic_x2apic_uv_x
+#endif
+                      ) {
+               if (x2apic_phys)
+                       apic = &apic_x2apic_phys;
+               else
+                       apic = &apic_x2apic_cluster;
+               printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
        }
 #endif
 
@@ -62,8 +74,17 @@ void __init default_setup_apic_routing(void)
                printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
        }
 
-       if (x86_quirks->update_apic)
-               x86_quirks->update_apic();
+       if (is_vsmp_box()) {
+               /* need to update phys_pkg_id */
+               apic->phys_pkg_id = apicid_phys_pkg_id;
+       }
+
+       /*
+        * Now that apic routing model is selected, configure the
+        * fault handling for intr remapping.
+        */
+       if (intr_remapping_enabled)
+               enable_drhd_fault_handling();
 }
 
 /* Same for both flat and physical. */