Kernel panic at early boot time
mnln.l4 at gmail.com
Thu Aug 9 00:27:00 UTC 2012
I finally have some time to take a closer look at this issue. Yes, it
is caused by SMI#. DragonflyBSD has tried to fix the similar problem
But Windows and Linux don't cause such problem on my machine.
I compared MP initialization code between FreeBSD, Linux and NetBSD. I
believe the problem is FreeBSD doesn't wait for 10ms between IPI_INIT
assert and IPI_INIT deassert (though FreeBSD waits for 10ms after
IPI_INIT deassert). After inserting 10ms wait time, the issue is
solved. BTW, Intel's MP spec 1.4 doesn't explain very well either.
Patch for AMD64 (similar change for i386 as well)
--- mp_machdep.c (revision 239120)
+++ mp_machdep.c (working copy)
@@ -993,6 +993,8 @@
lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id);
+ DELAY(10000); /* wait ~10mS */
/* wait for pending status end */
1. FreeBSD's ap_start() method:
2. Linux's wakeup_secondary_cpu_via_init() method:
3. NetBSD's x86_ipi_init() method:
On Fri, Jun 22, 2012 at 6:55 PM, mnln.l4 <mnln.l4 at gmail.com> wrote:
> Thanks for explaining the cause!
> On Tue, Jun 19, 2012 at 4:54 AM, John Baldwin <jhb at freebsd.org> wrote:
>> On Sunday, June 17, 2012 2:35:14 pm mnln.l4 wrote:
>> > I get a kernel panic at early boot time on 9.0-stable (r237150),
>> > GENERIC,
>> > AMD64.
>> > Repro step:
>> > 1. Boot, wait for welcome screen.
>> > 2. Repeat pressing Enter key rapidly (so kernel is loading, don't stop
>> > pressing Enter key).
>> > 3. See the following message at early boot
>> So don't do that. All your key presses are triggering SMI# events that
>> interfering with the AP's ability to respond to its startup IPI. There is
>> nothing we can do about this in the OS.
>> John Baldwin
More information about the freebsd-stable