amd64: MCOUNT_EXIT: restore interrupts, don't unconditionally reenable them
authorcheloha <cheloha@openbsd.org>
Tue, 27 Jun 2023 10:11:15 +0000 (10:11 +0000)
committercheloha <cheloha@openbsd.org>
Tue, 27 Jun 2023 10:11:15 +0000 (10:11 +0000)
commit08cf7c3f88334cf737af7753d1b04496aca85a86
treef0611d863c7f3378a987b4faafbf86515e84323a
parent8370bf70c786bf5f8c3e53fb889a14ffef8cff1d
amd64: MCOUNT_EXIT: restore interrupts, don't unconditionally reenable them

This bug can cause all sorts of problems, but in particular it was
most easily reproduced as a double fault in the syscall return path on
this CPU model:

Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz

Tons of help from guenther@ in narrowing down the root cause.  Fix
tweaked by guenther@.  Additional input from deraadt@ and kettenis@.

ok guenther@
sys/arch/amd64/include/profile.h