summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mp_machdep.c
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2011-06-06 14:23:13 +0000
committeravg <avg@FreeBSD.org>2011-06-06 14:23:13 +0000
commit9162612be720dd56acd0c28c65c7bfe154594159 (patch)
tree7dddde5742ae73f5dda345eb798c5f445b0cb14a /sys/amd64/amd64/mp_machdep.c
parent7dc7ed779295dad8446c4d2f5cde121d28b2ff3b (diff)
downloadFreeBSD-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/amd64/amd64/mp_machdep.c')
-rw-r--r--sys/amd64/amd64/mp_machdep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 5c90034..c53d10a 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -241,8 +241,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;
OpenPOWER on IntegriCloud