Fix caveat in new implementation of linprocfs_docpuinfo():

Prevent kernel panic in case that extended-cpuid isn't supported by CPU

Reviewed by:	kib, ngie, trasz
Approved by:	trasz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11294
This commit is contained in:
Mahdi Mokhtari 2017-06-23 10:36:27 +00:00
parent d44b45df2c
commit 4b36080668
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320265

View File

@ -245,7 +245,10 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
break;
}
#endif
do_cpuid(0x80000006, cache_size);
if (cpu_exthigh >= 0x80000006)
do_cpuid(0x80000006, cache_size);
else
memset(cache_size, 0, sizeof(cache_size));
for (i = 0; i < mp_ncpus; ++i) {
fqmhz = 0;
fqkhz = 0;