Skip to content

Commit eec62f6

Browse files
Brian GerstIngo Molnar
authored andcommitted
x86/entry/compat: Combine return value test from syscall handler
Move the sysret32_from_system_call label to remove a duplicate test of the return value from the syscall handler. Signed-off-by: Brian Gerst <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent eb43c9b commit eec62f6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arch/x86/entry/entry_64_compat.S

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL)
118118

119119
movq %rsp, %rdi
120120
call do_SYSENTER_32
121-
/* XEN PV guests always use IRET path */
122-
ALTERNATIVE "testl %eax, %eax; jz swapgs_restore_regs_and_return_to_usermode", \
123-
"jmp swapgs_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV
124121
jmp sysret32_from_system_call
125122

126123
.Lsysenter_fix_flags:
@@ -212,13 +209,15 @@ SYM_INNER_LABEL(entry_SYSCALL_compat_after_hwframe, SYM_L_GLOBAL)
212209

213210
movq %rsp, %rdi
214211
call do_fast_syscall_32
212+
213+
sysret32_from_system_call:
215214
/* XEN PV guests always use IRET path */
216215
ALTERNATIVE "testl %eax, %eax; jz swapgs_restore_regs_and_return_to_usermode", \
217216
"jmp swapgs_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV
218217

219-
/* Opportunistic SYSRET */
220-
sysret32_from_system_call:
221218
/*
219+
* Opportunistic SYSRET
220+
*
222221
* We are not going to return to userspace from the trampoline
223222
* stack. So let's erase the thread stack right now.
224223
*/

0 commit comments

Comments
 (0)