summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_64.S
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-04-08 09:01:54 +0200
committerIngo Molnar <mingo@kernel.org>2015-04-08 09:01:54 +0200
commit4bcc7827b02feea2c762fa6d46a1bffb300d7403 (patch)
tree45fd2b64247cd44201fe519720494d4bf01b7014 /arch/x86/kernel/entry_64.S
parent3f705dfdf85a6416f5f12e52b7610144a99cbedc (diff)
parentf22e6e847115abc3a0e2ad7bb18d243d42275af1 (diff)
downloadblackbird-op-linux-4bcc7827b02feea2c762fa6d46a1bffb300d7403.tar.gz
blackbird-op-linux-4bcc7827b02feea2c762fa6d46a1bffb300d7403.zip
Merge tag 'v4.0-rc7' into x86/asm, to resolve conflicts
Conflicts: arch/x86/kernel/entry_64.S Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r--arch/x86/kernel/entry_64.S16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index f4270ff73f2a..65485b3baa59 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -706,7 +706,21 @@ retint_swapgs: /* return to user-space */
cmpq %r11,EFLAGS(%rsp) /* R11 == RFLAGS */
jne opportunistic_sysret_failed
- testq $X86_EFLAGS_RF,%r11 /* sysret can't restore RF */
+ /*
+ * SYSRET can't restore RF. SYSRET can restore TF, but unlike IRET,
+ * restoring TF results in a trap from userspace immediately after
+ * SYSRET. This would cause an infinite loop whenever #DB happens
+ * with register state that satisfies the opportunistic SYSRET
+ * conditions. For example, single-stepping this user code:
+ *
+ * movq $stuck_here,%rcx
+ * pushfq
+ * popq %r11
+ * stuck_here:
+ *
+ * would never get past 'stuck_here'.
+ */
+ testq $(X86_EFLAGS_RF|X86_EFLAGS_TF), %r11
jnz opportunistic_sysret_failed
/* nothing to check for RSP */
OpenPOWER on IntegriCloud