Page MenuHomeFreeBSD

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

Authored by kib on Dec 25 2020, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 10:37 PM
Unknown Object (File)
Dec 14 2023, 8:24 PM
Unknown Object (File)
Sep 1 2023, 10:15 PM
Unknown Object (File)
Aug 16 2023, 9:26 AM
Unknown Object (File)
Aug 16 2023, 6:24 AM
Unknown Object (File)
Jul 10 2023, 10:59 PM
Unknown Object (File)
Jul 4 2023, 5:56 PM
Unknown Object (File)
Jul 4 2023, 5:56 PM
Subscribers

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
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.
sys/amd64/amd64/exception.S
943

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.