From owner-cvs-src-old@FreeBSD.ORG Wed May 13 17:54:00 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 820B21065670 for ; Wed, 13 May 2009 17:54:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6665D8FC18 for ; Wed, 13 May 2009 17:54:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n4DHs0AY048232 for ; Wed, 13 May 2009 17:54:00 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4DHs0NN048231 for cvs-src-old@freebsd.org; Wed, 13 May 2009 17:54:00 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <200905131754.n4DHs0NN048231@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Wed, 13 May 2009 17:53:04 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/amd64/amd64 machdep.c mca.c mp_machdep.c trap.c src/sys/amd64/include mca.h specialreg.h src/sys/conf files.amd64 files.i386 src/sys/i386/i386 machdep.c mca.c mp_machdep.c trap.c src/sys/i386/include mca.h specialreg.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2009 17:54:00 -0000 jhb 2009-05-13 17:53:04 UTC FreeBSD src repository Modified files: sys/amd64/amd64 machdep.c mp_machdep.c trap.c sys/amd64/include specialreg.h sys/conf files.amd64 files.i386 sys/i386/i386 machdep.c mp_machdep.c trap.c sys/i386/include specialreg.h Added files: sys/amd64/amd64 mca.c sys/amd64/include mca.h sys/i386/i386 mca.c sys/i386/include mca.h Log: SVN rev 192050 on 2009-05-13 17:53:04Z by jhb Implement simple machine check support for amd64 and i386. - For CPUs that only support MCE (the machine check exception) but not MCA (i.e. Pentium), all this does is print out the value of the machine check registers and then panic when a machine check exception occurs. - For CPUs that support MCA (the machine check architecture), the support is a bit more involved. - First, there is limited support for decoding the CPU-independent MCA error codes in the kernel, and the kernel uses this to output a short description of any machine check events that occur. - When a machine check exception occurs, all of the MCx banks on the current CPU are scanned and any events are reported to the console before panic'ing. - To catch events for correctable errors, a periodic timer kicks off a task which scans the MCx banks on all CPUs. The frequency of these checks is controlled via the "hw.mca.interval" sysctl. - Userland can request an immediate scan of the MCx banks by writing a non-zero value to "hw.mca.force_scan". - If any correctable events are encountered, the appropriate details are stored in a 'struct mca_record' (defined in ). The "hw.mca.count" is a count of such records and each record may be queried via the "hw.mca.records" tree by specifying the record index (0 .. count - 1) as the next name in the MIB similar to using PIDs with the kern.proc.* sysctls. The idea is to export machine check events to userland for more detailed processing. - The periodic timer and hw.mca sysctls are only present if the CPU supports MCA. Discussed with: emaste (briefly) MFC after: 1 month Revision Changes Path 1.700 +2 -0 src/sys/amd64/amd64/machdep.c 1.1 +530 -0 src/sys/amd64/amd64/mca.c (new) 1.307 +3 -0 src/sys/amd64/amd64/mp_machdep.c 1.332 +7 -0 src/sys/amd64/amd64/trap.c 1.1 +48 -0 src/sys/amd64/include/mca.h (new) 1.55 +28 -0 src/sys/amd64/include/specialreg.h 1.138 +1 -0 src/sys/conf/files.amd64 1.622 +1 -0 src/sys/conf/files.i386 1.683 +2 -0 src/sys/i386/i386/machdep.c 1.1 +530 -0 src/sys/i386/i386/mca.c (new) 1.300 +3 -0 src/sys/i386/i386/mp_machdep.c 1.320 +7 -0 src/sys/i386/i386/trap.c 1.1 +48 -0 src/sys/i386/include/mca.h (new) 1.52 +28 -0 src/sys/i386/include/specialreg.h