diff options
author | avg <avg@FreeBSD.org> | 2011-06-06 14:23:13 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-06-06 14:23:13 +0000 |
commit | 9162612be720dd56acd0c28c65c7bfe154594159 (patch) | |
tree | 7dddde5742ae73f5dda345eb798c5f445b0cb14a /sys/i386 | |
parent | 7dc7ed779295dad8446c4d2f5cde121d28b2ff3b (diff) | |
download | FreeBSD-src-9162612be720dd56acd0c28c65c7bfe154594159.zip FreeBSD-src-9162612be720dd56acd0c28c65c7bfe154594159.tar.gz |
don't use cpuid level 4 in x86 cpu topology detection if it's not supported
This regression was introduced in r213323.
There are probably no Intel cpus that support amd64 mode, but do not
support cpuid level 4, but it's better to keep i386 and amd64 versions
of this code in sync.
Discovered by: pho
Tested by: pho
MFC after: 2 weeks
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index a4db401..904af80 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -289,8 +289,11 @@ topo_probe_0x4(void) * logical processors that belong to the same core * as BSP thus deducing number of threads per core. */ - cpuid_count(0x04, 0, p); - max_cores = ((p[0] >> 26) & 0x3f) + 1; + if (cpu_high >= 0x4) { + cpuid_count(0x04, 0, p); + max_cores = ((p[0] >> 26) & 0x3f) + 1; + } else + max_cores = 1; core_id_bits = mask_width(max_logical/max_cores); if (core_id_bits < 0) return; |