Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2011 07:18:14 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r223413 - in stable/8/sys: amd64/amd64 i386/i386
Message-ID:  <201106220718.p5M7IEBj037069@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Jun 22 07:18:14 2011
New Revision: 223413
URL: http://svn.freebsd.org/changeset/base/223413

Log:
  MFC r222756: don't use cpuid level 4 in x86 cpu topology detection if
  it's not supported

Modified:
  stable/8/sys/amd64/amd64/mp_machdep.c
  stable/8/sys/i386/i386/mp_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/mp_machdep.c	Wed Jun 22 07:15:57 2011	(r223412)
+++ stable/8/sys/amd64/amd64/mp_machdep.c	Wed Jun 22 07:18:14 2011	(r223413)
@@ -234,8 +234,11 @@ topo_probe_0x4(void)
 	 * logical processors that belong to the same core
 	 * as BSP thus deducing number of threads per core.
 	 */
-	cpuid_count(0x04, 0, p);
-	max_cores = ((p[0] >> 26) & 0x3f) + 1;
+	if (cpu_high >= 0x4) {
+		cpuid_count(0x04, 0, p);
+		max_cores = ((p[0] >> 26) & 0x3f) + 1;
+	} else
+		max_cores = 1;
 	core_id_bits = mask_width(max_logical/max_cores);
 	if (core_id_bits < 0)
 		return;

Modified: stable/8/sys/i386/i386/mp_machdep.c
==============================================================================
--- stable/8/sys/i386/i386/mp_machdep.c	Wed Jun 22 07:15:57 2011	(r223412)
+++ stable/8/sys/i386/i386/mp_machdep.c	Wed Jun 22 07:18:14 2011	(r223413)
@@ -288,8 +288,11 @@ topo_probe_0x4(void)
 	 * logical processors that belong to the same core
 	 * as BSP thus deducing number of threads per core.
 	 */
-	cpuid_count(0x04, 0, p);
-	max_cores = ((p[0] >> 26) & 0x3f) + 1;
+	if (cpu_high >= 0x4) {
+		cpuid_count(0x04, 0, p);
+		max_cores = ((p[0] >> 26) & 0x3f) + 1;
+	} else
+		max_cores = 1;
 	core_id_bits = mask_width(max_logical/max_cores);
 	if (core_id_bits < 0)
 		return;



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