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)
Wed, Nov 13, 12:43 PM
Unknown Object (File)
Tue, Oct 29, 3:06 PM
Unknown Object (File)
Oct 7 2024, 9:34 AM
Unknown Object (File)
Oct 5 2024, 5:46 AM
Unknown Object (File)
Sep 30 2024, 6:20 PM
Unknown Object (File)
Sep 30 2024, 12:53 AM
Unknown Object (File)
Sep 29 2024, 8:40 AM
Unknown Object (File)
Sep 18 2024, 11:31 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.