From 5127ce9217dfbaa8326683626b7085ffec68556e Mon Sep 17 00:00:00 2001 From: Matheus Date: Sat, 3 Sep 2022 13:13:07 -0300 Subject: [PATCH] x86_64 syscalls: enable interrupts after loading sane state --- src/arch/x86_64/syscall.asm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arch/x86_64/syscall.asm b/src/arch/x86_64/syscall.asm index 602f2031..946043a5 100644 --- a/src/arch/x86_64/syscall.asm +++ b/src/arch/x86_64/syscall.asm @@ -46,6 +46,8 @@ asm_syscall_entry: push qword [gs:0] ; save old stack mov [gs:0], rsp ; return back the kernel stack add qword [gs:0], 8 ; fix it + + sti push rcx ; old rip push r11 ; old rflags @@ -90,6 +92,8 @@ asm_syscall_entry: mov es,r11 mov ds,r11 + cli + pop r11 pop rcx pop rsp