arch/x64:Fix the issue where RFLAGS is not restored after a syscall return

When a syscall is invoked, the RFLAGS register is saved into R11. It must be restored before returning

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
This commit is contained in:
liwenxiang1
2025-05-28 10:53:02 +08:00
committed by Xiang Xiao
parent 794c325947
commit addc6b165a
+4
View File
@@ -696,6 +696,10 @@ no_kstack_switch:
syscall_no_ring3:
# endif
/* Restore the value of RFLAGS from R11 */
pushq %r11
popfq
/* Return to address pointed in RCX - must be on stack */
pushq %rcx
ret