Date: Wed, 13 May 2009 17:53:04 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: cvs-src-old@freebsd.org 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 Message-ID: <200905131754.n4DHs0NN048231@repoman.freebsd.org>
index | next in thread | raw e-mail
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 <machine/mca.h>).
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905131754.n4DHs0NN048231>
