Skip to content

Commit eb43c9b

Browse files
Brian GerstIngo Molnar
authored andcommitted
x86/entry/64: Remove obsolete comment on tracing vs. SYSRET
This comment comes from a time when the kernel attempted to use SYSRET on all returns to userspace, including interrupts and exceptions. Ever since commit fffbb5d ("Move opportunistic sysret code to syscall code path"), SYSRET is only used for returning from system calls. The specific tracing issue listed in this comment is not possible anymore. Signed-off-by: Brian Gerst <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3fc18b0 commit eb43c9b

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

arch/x86/entry/entry_64.S

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,9 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL)
166166
jne swapgs_restore_regs_and_return_to_usermode
167167

168168
/*
169-
* SYSCALL clears RF when it saves RFLAGS in R11 and SYSRET cannot
170-
* restore RF properly. If the slowpath sets it for whatever reason, we
171-
* need to restore it correctly.
172-
*
173-
* SYSRET can restore TF, but unlike IRET, restoring TF results in a
174-
* trap from userspace immediately after SYSRET. This would cause an
175-
* infinite loop whenever #DB happens with register state that satisfies
176-
* the opportunistic SYSRET conditions. For example, single-stepping
177-
* this user code:
178-
*
179-
* movq $stuck_here, %rcx
180-
* pushfq
181-
* popq %r11
182-
* stuck_here:
183-
*
184-
* would never get past 'stuck_here'.
169+
* SYSRET cannot restore RF. It can restore TF, but unlike IRET,
170+
* restoring TF results in a trap from userspace immediately after
171+
* SYSRET.
185172
*/
186173
testq $(X86_EFLAGS_RF|X86_EFLAGS_TF), %r11
187174
jnz swapgs_restore_regs_and_return_to_usermode

0 commit comments

Comments
 (0)