summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2006-04-24 22:23:52 +0000
committerjkim <jkim@FreeBSD.org>2006-04-24 22:23:52 +0000
commit6b218fc19f140393fd752ccde8988fc6c59b993e (patch)
tree3f44385bab1ba00c151fb27541ab68c0debc559a /sys/i386
parente3ef44f73da7755cbd500b3367d52691a8908dff (diff)
downloadFreeBSD-src-6b218fc19f140393fd752ccde8988fc6c59b993e.zip
FreeBSD-src-6b218fc19f140393fd752ccde8988fc6c59b993e.tar.gz
Check if deterministic cache parameters leaf is valid before use.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/identcpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index 0296aea..374c46b 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -856,7 +856,8 @@ printcpuinfo(void)
else if (strcmp(cpu_vendor, "GenuineIntel") == 0 &&
(cpu_high >= 4)) {
cpuid_count(4, 0, regs);
- cmp = ((regs[0] & 0xfc000000) >> 26) + 1;
+ if ((regs[0] & 0x1f) != 0)
+ cmp = ((regs[0] >> 26) & 0x3f) + 1;
}
if (cmp > 1)
printf("\n Cores per package: %d", cmp);
OpenPOWER on IntegriCloud