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)
@@ -812,6 +812,19 @@
        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)
@@ -328,7 +328,6 @@
 #ifndef XEN
        cpu_setregs();
 #endif
-       mca_init();
 }
 
 /*
Index: amd64/amd64/mca.c
===================================================================
--- amd64/amd64/mca.c   (revision 208545)
+++ amd64/amd64/mca.c   (working copy)
@@ -789,6 +789,19 @@
        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)
@@ -285,7 +285,6 @@
        vm_pager_bufferinit();
 
        cpu_setregs();
-       mca_init();
 }
 
 /*

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to