From owner-svn-src-all@FreeBSD.ORG Fri May 28 17:50:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E66D1065675; Fri, 28 May 2010 17:50:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 741198FC14; Fri, 28 May 2010 17:50:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SHoOhf064719; Fri, 28 May 2010 17:50:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SHoOE6064714; Fri, 28 May 2010 17:50:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005281750.o4SHoOE6064714@svn.freebsd.org> From: John Baldwin Date: Fri, 28 May 2010 17:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208621 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 17:50:24 -0000 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)