From owner-freebsd-stable@FreeBSD.ORG Wed Feb 13 16:00:04 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C52AEE08 for ; Wed, 13 Feb 2013 16:00:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id A3234C05 for ; Wed, 13 Feb 2013 16:00:04 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0A72CB9A1; Wed, 13 Feb 2013 11:00:04 -0500 (EST) From: John Baldwin To: CeDeROM Subject: Re: 9.1-RELEASE AMD64 crash under VBox 4.2.6 when IO APIC is disabled Date: Wed, 13 Feb 2013 10:48:06 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201302111606.06731.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201302131048.06370.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 13 Feb 2013 11:00:04 -0500 (EST) Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 13 Feb 2013 16:00:04 -0000 On Monday, February 11, 2013 4:34:37 pm CeDeROM wrote: > On Mon, Feb 11, 2013 at 10:06 PM, John Baldwin wrote: > > On Sunday, February 10, 2013 1:16:16 pm CeDeROM wrote: > >> Hey :-) I have just noticed that booting installation media for > >> FreeBSD 9.1-RELEASE AMD64 from ISO bootonly under VirtualBox 4.2.6 > >> results in a kernel panic both when ACPI is enabled and disabled in > > > > You will need to add 'device atpic' to your kernel config and build a custom > > kernel. All real amd64-capable hardware has APICs. > > Hello John :-) Thank you for your reply, still I need some more > information to understand why this happens :-) > > The simple answer that I have deduced is that APIC is MANDATORY for > AMD64 machines and they won't run otherwise? This is why generic AMD64 > install fails when no APIC is enabled in the VBox? No, it is not quite like that. x86 machines have two entirely different sets of interrupt controllers. Old i386 machines only had a pair of 8259A controllers (this is what 'device atpic' manages), and i386 kernels assume they are always present (see sys/i386/conf/DEFAULTS). When Intel added SMP support to i386 machines starting with the 486 and Pentium they added a new set of interrupt controllers called APICs (both I/O APICs to manage device interrupts ala the 8259As and on-CPU APICs on Pentium and later called local APICs). "device apic" enables use of APICs. The code to manage these is actually shared between i386 and amd64 and any x86 kernel can use one or the other of these _if_ the relevant driver is compiled in. On i386 'device atpic' is enabled by default (via DEFAULTS) and 'device apic' is enabled in GENERIC, so i386 kernels will work with both out of the box. On amd64, 'device atpic' is not enabled by default (not in GENERIC), but 'device apic' is mandated to be on (it's not even an option, just always compiled in). So GENERIC on amd64 only supports 'device apic' by default. You can use 'device atpic' on amd64 if you really want to, but APICs are more efficient and required for using multiple CPUs, so unless you are working around a specific hardware bug (or writing a hypervisor where you haven't implemented APIC emulation yet), you should prefer APIC. -- John Baldwin