From owner-freebsd-stable@FreeBSD.ORG Wed Nov 3 08:49:07 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C14CE1065679 for ; Wed, 3 Nov 2010 08:49:07 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1051B8FC23 for ; Wed, 3 Nov 2010 08:49:06 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA01976; Wed, 03 Nov 2010 10:48:51 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PDZ1W-0009x7-Td; Wed, 03 Nov 2010 10:48:50 +0200 Message-ID: <4CD121F2.3010508@freebsd.org> Date: Wed, 03 Nov 2010 10:48:50 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Dan Allen References: <68E248E0-8619-4859-BFFE-1B5F5ABBC51F@airwired.net> <4CD11FE9.8050105@freebsd.org> In-Reply-To: <4CD11FE9.8050105@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Sergey Kandaurov , FreeBSD-STABLE Mailing List Subject: Re: Fatal trap 18 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2010 08:49:07 -0000 on 03/11/2010 10:40 Andriy Gapon said the following: > This problem seems to happen only on SMP systems that for some reason run as UP. > E.g. because ACPI and/or APIC are disabled. > Or some other BIOS configuration. > But I am not sure what exactly is the case here. > Verbose dmesg from a working kernel would be helpful. I still would like to see verbose dmesg, just to be sure what's going on. Here's a patch that I have in mind for this issue, if it is what I think it is. If you have amd64 system, the patch is equally applicable to sys/amd64/amd64/mp_machdep.c. Index: sys/i386/i386/mp_machdep.c =================================================================== --- sys/i386/i386/mp_machdep.c (revision 214619) +++ sys/i386/i386/mp_machdep.c (working copy) @@ -286,6 +286,9 @@ cpu_logical++; } + KASSERT(cpu_cores >= 1 && cpu_logical >= 1, + ("topo_probe_0x4 couldn't find BSP")); + cpu_cores /= cpu_logical; hyperthreading_cpus = cpu_logical; } @@ -357,7 +360,9 @@ 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) { /* @@ -379,10 +384,8 @@ * 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; } -- Andriy Gapon