@@ -120,25 +120,10 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL)
120120 call do_syscall_64 /* returns with IRQs disabled */
121121
122122 // 終わりしよ!
123- POP_REGS pop_rdi =0
124-
125- // make a debug signal to QEMU
126- // push %dx
127- // push %ax
128- // push %bx
129- // mov $0x2333, %dx // destination port
130- // mov $0xE399, %ax // dump stack command
131- // mov $(6+56), %bx // dump length
132- // out %ax, %dx
133- // pop %bx
134- // pop %ax
135- // pop %dx
136-
137- // The stack is now: user_RDI, orig_ax, RIP, CS, EFLAGS, RSP, SS.
138- SWITCH_TO_USER_CR3_STACK scratch_reg =%rdi
139- popq %rdi
123+ POP_REGS
124+ // The stack is now: RAX, RIP, CS, EFLAGS, RSP, SS
140125 add $8 , %rsp // skip RAX
141- // ready to go !
126+ // Go !
142127SYM_INNER_LABEL(entry_SYSRETQ_unsafe_stack, SYM_L_GLOBAL)
143128 ANNOTATE_NOENDBR
144129 swapgs
@@ -665,18 +650,12 @@ SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL)
665650 ALTERNATIVE "", " jmp xenpv_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV
666651#endif
667652
668- POP_REGS pop_rdi =0
669-
670- /*
671- * The stack is now user RDI, orig_ax, RIP, CS, EFLAGS, RSP, SS.
672- * Save old stack pointer and switch to trampoline stack.
673- */
674-
675- SWITCH_TO_USER_CR3_STACK scratch_reg =%rdi
676- popq %rdi
653+ POP_REGS
654+ // The stack is now: RAX, RIP, CS, EFLAGS, RSP, SS
677655 add $8 , %rsp // skip RAX
656+ // Go!
678657 swapgs
679- jmp .Lnative_iret
658+ iretq
680659
681660SYM_INNER_LABEL(restore_regs_and_return_to_kernel, SYM_L_GLOBAL)
682661 POP_REGS
0 commit comments