Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jun 2017 10:36:27 +0000 (UTC)
From:      Mahdi Mokhtari <mmokhi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320265 - head/sys/compat/linprocfs
Message-ID:  <201706231036.v5NAaSU8061376@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmokhi (ports committer)
Date: Fri Jun 23 10:36:27 2017
New Revision: 320265
URL: https://svnweb.freebsd.org/changeset/base/320265

Log:
  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

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Fri Jun 23 10:09:49 2017	(r320264)
+++ head/sys/compat/linprocfs/linprocfs.c	Fri Jun 23 10:36:27 2017	(r320265)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706231036.v5NAaSU8061376>