From owner-svn-src-stable@FreeBSD.ORG Sun Nov 7 18:25:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7801B106564A; Sun, 7 Nov 2010 18:25:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7B28FC16; Sun, 7 Nov 2010 18:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7IPhRY069739; Sun, 7 Nov 2010 18:25:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7IPhSs069736; Sun, 7 Nov 2010 18:25:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011071825.oA7IPhSs069736@svn.freebsd.org> From: Andriy Gapon Date: Sun, 7 Nov 2010 18:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214937 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 18:25:43 -0000 Author: avg Date: Sun Nov 7 18:25:42 2010 New Revision: 214937 URL: http://svn.freebsd.org/changeset/base/214937 Log: MFC r214774: x86 topo_probe: do not probe smp topology if only one cpu is visible 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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Sun Nov 7 18:21:42 2010 (r214936) +++ stable/8/sys/amd64/amd64/mp_machdep.c Sun Nov 7 18:25:42 2010 (r214937) @@ -231,6 +231,9 @@ topo_probe_0x4(void) cpu_logical++; } + KASSERT(cpu_cores >= 1 && cpu_logical >= 1, + ("topo_probe_0x4 couldn't find BSP")); + cpu_cores /= cpu_logical; hyperthreading_cpus = cpu_logical; } @@ -302,7 +305,9 @@ topo_probe(void) return; logical_cpus_mask = 0; - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (mp_ncpus <= 1) + cpu_cores = cpu_logical = 1; + else if (cpu_vendor_id == CPU_VENDOR_AMD) topo_probe_amd(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) { /* @@ -324,10 +329,8 @@ topo_probe(void) * Fallback: assume each logical CPU is in separate * physical package. That is, no multi-core, no SMT. */ - if (cpu_cores == 0) - cpu_cores = 1; - if (cpu_logical == 0) - cpu_logical = 1; + if (cpu_cores == 0 || cpu_logical == 0) + cpu_cores = cpu_logical = 1; cpu_topo_probed = 1; } Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Sun Nov 7 18:21:42 2010 (r214936) +++ stable/8/sys/i386/i386/mp_machdep.c Sun Nov 7 18:25:42 2010 (r214937) @@ -285,6 +285,9 @@ topo_probe_0x4(void) cpu_logical++; } + KASSERT(cpu_cores >= 1 && cpu_logical >= 1, + ("topo_probe_0x4 couldn't find BSP")); + cpu_cores /= cpu_logical; hyperthreading_cpus = cpu_logical; } @@ -356,7 +359,9 @@ topo_probe(void) return; logical_cpus_mask = 0; - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (mp_ncpus <= 1) + cpu_cores = cpu_logical = 1; + else if (cpu_vendor_id == CPU_VENDOR_AMD) topo_probe_amd(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) { /* @@ -378,10 +383,8 @@ topo_probe(void) * Fallback: assume each logical CPU is in separate * physical package. That is, no multi-core, no SMT. */ - if (cpu_cores == 0) - cpu_cores = 1; - if (cpu_logical == 0) - cpu_logical = 1; + if (cpu_cores == 0 || cpu_logical == 0) + cpu_cores = cpu_logical = 1; cpu_topo_probed = 1; }