x86: make amd quad core 8 socket system not be clustered_box, #2
authorYinghai Lu <Yinghai.Lu@Sun.COM>
Sun, 24 Feb 2008 05:48:42 +0000 (21:48 -0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:40:49 +0000 (17:40 +0200)
quad core 8 socket system will have apic id lifting.the apic id range could
be [4, 0x23]. and apic_is_clustered_box will think that need to three clusters
and that is large than 2. So it is treated as clustered_box.

and will get

Marking TSC unstable due to TSCs unsynchronized

even the CPUs have X86_FEATURE_CONSTANT_TSC set.

this patch will check if the cpu is from AMD.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic_64.c

index d8d03e09dea24a45e94903ae1c61a646d65777d1..7d8ffdaa0ab3f646297865b7e95a76f5e3b5f093 100644 (file)
@@ -1180,9 +1180,19 @@ __cpuinit int apic_is_clustered_box(void)
 {
        int i, clusters, zeros;
        unsigned id;
-       u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
+       u16 *bios_cpu_apicid;
        DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
 
+       /*
+        * there is not this kind of box with AMD CPU yet.
+        * Some AMD box with quadcore cpu and 8 sockets apicid
+        * will be [4, 0x23] or [8, 0x27] could be thought to
+        * have three apic_clusters. So go out early.
+        */
+       if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+               return 0;
+
+       bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
        bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
 
        for (i = 0; i < NR_CPUS; i++) {