Re: panic: lapic_enable_cmc: missing APIC 0

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 26 May 2010 08:26:30 -0400
On Tuesday 25 May 2010 6:04:04 am Ronald van der Pol wrote:
> I am trying to move to current from 8.1-PRERELEASE. After
> buildworld, buildkernel, installkernel and rebooting I get:
> 
> panic: lapic_enable_cmc: missing APIC 0
> cpuid = 0
> KDB: enter : panic

Try this patch:

Index: i386/i386/mca.c
===================================================================
--- i386/i386/mca.c	(revision 208556)
+++ i386/i386/mca.c	(working copy)
_at__at_ -812,6 +812,19 _at__at_
 	load_cr4(rcr4() | CR4_MCE);
 }
 
+/*
+ * The machine check registers for the BSP cannot be initialized until
+ * the local APIC is initialized.  This happens at SI_SUB_CPU,
+ * SI_ORDER_SECOND.
+ */
+static void
+mca_init_bsp(void *arg __unused)
+{
+
+	mca_init();
+}
+SYSINIT(mca_init_bsp, SI_SUB_CPU, SI_ORDER_ANY, mca_init_bsp, NULL);
+
 /* Called when a machine check exception fires. */
 int
 mca_intr(void)
Index: i386/i386/machdep.c
===================================================================
--- i386/i386/machdep.c	(revision 208545)
+++ i386/i386/machdep.c	(working copy)
_at__at_ -328,7 +328,6 _at__at_
 #ifndef XEN
 	cpu_setregs();
 #endif
-	mca_init();
 }
 
 /*
Index: amd64/amd64/mca.c
===================================================================
--- amd64/amd64/mca.c	(revision 208545)
+++ amd64/amd64/mca.c	(working copy)
_at__at_ -789,6 +789,19 _at__at_
 	load_cr4(rcr4() | CR4_MCE);
 }
 
+/*
+ * The machine check registers for the BSP cannot be initialized until
+ * the local APIC is initialized.  This happens at SI_SUB_CPU,
+ * SI_ORDER_SECOND.
+ */
+static void
+mca_init_bsp(void *arg __unused)
+{
+
+	mca_init();
+}
+SYSINIT(mca_init_bsp, SI_SUB_CPU, SI_ORDER_ANY, mca_init_bsp, NULL);
+
 /* Called when a machine check exception fires. */
 int
 mca_intr(void)
Index: amd64/amd64/machdep.c
===================================================================
--- amd64/amd64/machdep.c	(revision 208545)
+++ amd64/amd64/machdep.c	(working copy)
_at__at_ -285,7 +285,6 _at__at_
 	vm_pager_bufferinit();
 
 	cpu_setregs();
-	mca_init();
 }
 
 /*

-- 
John Baldwin
Received on Wed May 26 2010 - 12:22:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:03 UTC