Page MenuHomeFreeBSD

amd64: preserve %cr2 in NMI/MCE/DBG handlers.

Authored by kib on Dec 25 2020, 10:04 PM.



These handlers could interrupt code which has interrupts disabled, and if a spurious page fault occurs during exception handler run, we get clobbered %cr2 in higher level stack.

This is mostly a speculation, but it is based on hints from good sources.

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Dec 25 2020, 10:04 PM
kib created this revision.
markj added inline comments.

BTW, I think this comment should say %ebx != 0 => return to userland. Same in the mchk handler. Assuming this is correct I'll fix it after this diff is pushed, or feel free to do it yourself.

This revision is now accepted and ready to land.Dec 27 2020, 3:30 AM
This revision was automatically updated to reflect the committed changes.