Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Feb 2013 10:48:06 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        CeDeROM <cederom@tlen.pl>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: 9.1-RELEASE AMD64 crash under VBox 4.2.6 when IO APIC is disabled
Message-ID:  <201302131048.06370.jhb@freebsd.org>
In-Reply-To: <CAFYkXjkAfR%2Bzj4X=ZjwNdWmqanfXCZRt37%2BB41VCM71z79g7qA@mail.gmail.com>
References:  <CAFYkXjknuDPr=FYxkj9eYDsSRh_kUa=9ubyDR=84=hWi85RTiw@mail.gmail.com> <201302111606.06731.jhb@freebsd.org> <CAFYkXjkAfR%2Bzj4X=ZjwNdWmqanfXCZRt37%2BB41VCM71z79g7qA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, February 11, 2013 4:34:37 pm CeDeROM wrote:
> On Mon, Feb 11, 2013 at 10:06 PM, John Baldwin <jhb@freebsd.org> 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



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