diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2006-04-25 00:06:37 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2006-04-25 00:06:37 +0000 |
| commit | daea0aad84389cc69a879383d281c44207d5f49a (patch) | |
| tree | e65e5bd15021682abd0e7307b37e034ebf4807f5 | |
| parent | d94607de56df97ff47cd23c783da61c7bdaefae2 (diff) | |
Notes
| -rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 8 | ||||
| -rw-r--r-- | sys/i386/i386/mp_machdep.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 7ba7643209da..226a95ca3f80 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -183,6 +183,7 @@ void mp_topology(void) { struct cpu_group *group; + u_int regs[4]; int logical_cpus; int apic_id; int groups; @@ -195,6 +196,13 @@ mp_topology(void) 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 < MAXCPU; apic_id++) { diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index bc5c65999f17..3bfce3639a89 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -240,6 +240,7 @@ void mp_topology(void) { struct cpu_group *group; + u_int regs[4]; int logical_cpus; int apic_id; int groups; @@ -252,6 +253,13 @@ mp_topology(void) 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 < MAXCPU; apic_id++) { |
