Skip to content

Commit 4b246ba

Browse files
xvancAndy-Python-Programmer
authored andcommitted
syscall: re-enable interrupts when returning with SYSEXIT
1 parent afbd916 commit 4b246ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/aero_kernel/src/arch/x86_64/syscall_handler.asm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,10 @@ x86_64_sysenter_handler:
160160
; execute `sysexit` with canonical addresses in RCX and RDX. Otherwise we would
161161
; fault in the kernel having already swapped back to the user's GS.
162162
swapgs
163+
164+
; SYSEXIT does *not* restore IF to re-enable interrupts.
165+
; This is done here, rather then when restoring RFLAGS above, since STI will
166+
; keep interrupts inhibited until after the *following* instruction executes.
167+
sti
163168
o64 sysexit
164169
.end:

0 commit comments

Comments
 (0)