From owner-svn-src-all@FreeBSD.ORG Sat Jul 3 20:19:20 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 EF107106566C; Sat, 3 Jul 2010 20:19:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C52A08FC87; Sat, 3 Jul 2010 20:19:20 +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 o63KJKa6015041; Sat, 3 Jul 2010 20:19:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o63KJKN6015037; Sat, 3 Jul 2010 20:19:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201007032019.o63KJKN6015037@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 3 Jul 2010 20:19:20 +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: r209671 - in head/sys/ia64: ia64 include 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: Sat, 03 Jul 2010 20:19:21 -0000 Author: marcel Date: Sat Jul 3 20:19:20 2010 New Revision: 209671 URL: http://svn.freebsd.org/changeset/base/209671 Log: Allocate and setup an interrupt vector for corrected machine checks. For now, just print when we get the interrupt, but eventually we need to collect the details and provide a more useful report. Modified: head/sys/ia64/ia64/mca.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/include/mca.h Modified: head/sys/ia64/ia64/mca.c ============================================================================== --- head/sys/ia64/ia64/mca.c Sat Jul 3 20:11:04 2010 (r209670) +++ head/sys/ia64/ia64/mca.c Sat Jul 3 20:19:20 2010 (r209671) @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +74,8 @@ SYSCTL_INT(_hw_mca, OID_AUTO, last, CTLF static struct mtx mca_sysctl_lock; +static u_int mca_xiv_cmc; + static int mca_sysctl_inject(SYSCTL_HANDLER_ARGS) { @@ -227,6 +231,26 @@ ia64_mca_save_state(int type) } } +static u_int +ia64_mca_intr(struct thread *td, u_int xiv, struct trapframe *tf) +{ + + if (xiv == mca_xiv_cmc) { + printf("MCA: corrected machine check (CMC) interrupt\n"); + return (0); + } + + return (0); +} + +void +ia64_mca_init_ap(void) +{ + + if (mca_xiv_cmc != 0) + ia64_set_cmcv(mca_xiv_cmc); +} + void ia64_mca_init(void) { @@ -289,4 +313,14 @@ ia64_mca_init(void) */ for (i = 0; i < SAL_INFO_TYPES; i++) ia64_mca_save_state(i); + + /* + * Allocate a XIV for CMC interrupts, so that we can collect and save + * the corrected processor checks. + */ + mca_xiv_cmc = ia64_xiv_alloc(PI_SOFT, IA64_XIV_PLAT, ia64_mca_intr); + if (mca_xiv_cmc != 0) + ia64_set_cmcv(mca_xiv_cmc); + else + printf("MCA: CMC vector could not be allocated\n"); } Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sat Jul 3 20:11:04 2010 (r209670) +++ head/sys/ia64/ia64/mp_machdep.c Sat Jul 3 20:19:20 2010 (r209671) @@ -163,6 +163,8 @@ ia64_store_mca_state(void* arg) sched_bind(td, pc->pc_cpuid); thread_unlock(td); + ia64_mca_init_ap(); + /* * Get and save the CPU specific MCA records. Should we get the * MCA state for each processor, or just the CMC state? Modified: head/sys/ia64/include/mca.h ============================================================================== --- head/sys/ia64/include/mca.h Sat Jul 3 20:11:04 2010 (r209670) +++ head/sys/ia64/include/mca.h Sat Jul 3 20:19:20 2010 (r209671) @@ -240,6 +240,7 @@ struct mca_pcidev_reg { #ifdef _KERNEL void ia64_mca_init(void); +void ia64_mca_init_ap(void); void ia64_mca_save_state(int); #endif /* _KERNEL */