A method and mechanism for error recovery in a processor. A multithreaded
processor is configured to utilize software for hardware detected machine
errors. Rather than correcting and clearing the detected errors, hardware
is configured to report the errors precisely. Both program-related
exceptions and hardware errors are detected and, without being corrected
by the hardware, flow down the pipeline to a trap unit where they are
prioritized and handled via software. The processor assigns each
instruction a thread ID and error information as it follows the pipeline.
The trap unit records the error by using the thread ID of the instruction
and the pipelined error information in order to determine which ESR
receives the information and what to store in the ESR. A trap handling
routine is then initiated to facilitate error recovery.