Date: Fri, 28 May 2010 17:50:24 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208621 - in head/sys: amd64/amd64 i386/i386 Message-ID: <201005281750.o4SHoOE6064714@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Fri May 28 17:50:24 2010 New Revision: 208621 URL: http://svn.freebsd.org/changeset/base/208621 Log: Defer initializing machine checks for the boot CPU until the local APIC is fully configured. MFC after: 1 month Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mca.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mca.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/amd64/amd64/machdep.c Fri May 28 17:50:24 2010 (r208621) @@ -285,7 +285,6 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); - mca_init(); } /* Modified: head/sys/amd64/amd64/mca.c ============================================================================== --- head/sys/amd64/amd64/mca.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/amd64/amd64/mca.c Fri May 28 17:50:24 2010 (r208621) @@ -789,6 +789,19 @@ mca_init(void) 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) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/i386/i386/machdep.c Fri May 28 17:50:24 2010 (r208621) @@ -328,7 +328,6 @@ cpu_startup(dummy) #ifndef XEN cpu_setregs(); #endif - mca_init(); } /* Modified: head/sys/i386/i386/mca.c ============================================================================== --- head/sys/i386/i386/mca.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/i386/i386/mca.c Fri May 28 17:50:24 2010 (r208621) @@ -812,6 +812,19 @@ mca_init(void) 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005281750.o4SHoOE6064714>