[This is a repost of an earlier patch now that I've had time to finish it and test it more thoroughly.] This patch adds support for sending a SIGBUS to a userspace application using /proc/bus/pci to drive a device if an I/O error occurs. We're using this in house for the X server's BIOS emulator and it seems to be working well. The idea is to track mmaped /proc/bus/pci regions so that the machine check handler is able to properly determine which process is responsible for any faults that occur (ia64 is interesting in that the error may not occur in the process context that actually generated the bad reference). If a match is found, a SIGBUS is sent to the process, along with the address that caused the fault. The machine check record is then cleared and recovery takes place (the assumption is that the signal to userspace is a sufficient record of the error). The patch also special cases memory mapping of legacy space, which is the first 64k of I/O space and the first megabyte of memory space. Sub platforms can optionally remap their bridge to the target bus and setup legacy handling in the callout. Comments? Given that this is working well for us, I'd like to get it upstream sometime soon. I also expect that it could be used to deal with more types of I/O errors, perhaps allowing the kernel to call a driver shutdown routine if an I/O error occurs in a kernel driver. Thanks, Jesse