From owner-svn-src-all@freebsd.org Fri Jun 23 10:36:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7459FDA18BF; Fri, 23 Jun 2017 10:36:29 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35C9E8078B; Fri, 23 Jun 2017 10:36:29 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5NAaSb9061377; Fri, 23 Jun 2017 10:36:28 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5NAaSU8061376; Fri, 23 Jun 2017 10:36:28 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201706231036.v5NAaSU8061376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Fri, 23 Jun 2017 10:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320265 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 10:36:29 -0000 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;