Index: local_apic.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/local_apic.c,v retrieving revision 1.42 diff -u -r1.42 local_apic.c --- local_apic.c 8 May 2007 22:01:03 -0000 1.42 +++ local_apic.c 27 Jul 2007 21:15:16 -0000 @@ -1064,10 +1070,6 @@ if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); -#ifdef SMP - /* Last, setup the cpu topology now that we have probed CPUs */ - mp_topology(); -#endif } SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_FIRST, apic_init, NULL) Index: mp_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/mp_machdep.c,v retrieving revision 1.280 diff -u -r1.280 mp_machdep.c --- mp_machdep.c 4 Jun 2007 23:56:07 -0000 1.280 +++ mp_machdep.c 27 Jul 2007 21:17:41 -0000 @@ -249,18 +249,8 @@ /* Build the smp_topology map. */ /* Nothing to do if there is no HTT support. */ - if ((cpu_feature & CPUID_HTT) == 0) + if (hyperthreading_cpus <= 1) return; - logical_cpus = (cpu_procinfo & CPUID_HTT_CORES) >> 16; - if (logical_cpus <= 1) - return; - /* Nothing to do if reported cores are physical cores. */ - if (strcmp(cpu_vendor, "GenuineIntel") == 0 && cpu_high >= 4) { - cpuid_count(4, 0, regs); - if ((regs[0] & 0x1f) != 0 && - logical_cpus <= ((regs[0] >> 26) & 0x3f) + 1) - return; - } group = &mp_groups[0]; groups = 1; for (cpu = 0, apic_id = 0; apic_id <= MAX_APIC_ID; apic_id++) { @@ -270,7 +260,8 @@ * If the current group has members and we're not a logical * cpu, create a new group. */ - if (group->cg_count != 0 && (apic_id % logical_cpus) == 0) { + if (group->cg_count != 0 && + (apic_id % hyperthreading_cpus) == 0) { group++; groups++; } @@ -469,6 +460,9 @@ } set_interrupt_apic_ids(); + + /* Last, setup the cpu topology now that we have probed CPUs */ + mp_topology(); }