x86: Fix bogus warning in apic_noop.apic_write()
[safe/jmp/linux-2.6] / arch / x86 / kernel / apic / probe_64.c
index f3b1037..c4cbd30 100644 (file)
@@ -44,6 +44,11 @@ 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.
  */
@@ -59,14 +64,26 @@ void __init default_setup_apic_routing(void)
                        apic = &apic_x2apic_phys;
                else
                        apic = &apic_x2apic_cluster;
-               printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
        }
 #endif
 
        if (apic == &apic_flat) {
-               if (max_physical_apicid >= 8)
-                       apic = &apic_physflat;
-               printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
+               switch (boot_cpu_data.x86_vendor) {
+               case X86_VENDOR_INTEL:
+                       if (num_processors > 8)
+                               apic = &apic_physflat;
+                       break;
+               case X86_VENDOR_AMD:
+                       if (max_physical_apicid >= 8)
+                               apic = &apic_physflat;
+               }
+       }
+
+       printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
+
+       if (is_vsmp_box()) {
+               /* need to update phys_pkg_id */
+               apic->phys_pkg_id = apicid_phys_pkg_id;
        }
 
        /*