mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Check if deterministic cache parameters leaf is valid before use.
This commit is contained in:
parent
95eb1796b1
commit
cf24d86bcc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158003
@ -360,7 +360,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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user