]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge branch 'x86/urgent' into x86/asm, to resolve conflict
authorIngo Molnar <mingo@kernel.org>
Tue, 24 Mar 2015 20:14:07 +0000 (21:14 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 25 Mar 2015 12:19:43 +0000 (13:19 +0100)
Conflicts:
arch/x86/kernel/entry_64.S

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
arch/x86/kernel/entry_64.S

index daf5d94c0e788bed953b8a573a36416711d54286,2babb393915e76dbeb8a1b757305b819fddd324b..bf9afadbb99e8f3eec711cf08097b72d6de0a6f4
@@@ -261,18 -358,27 +261,28 @@@ system_call_fastpath
        ja ret_from_sys_call  /* and return regs->ax */
        movq %r10,%rcx
        call *sys_call_table(,%rax,8)  # XXX:    rip relative
 -      movq %rax,RAX-ARGOFFSET(%rsp)
 +      movq %rax,RAX(%rsp)
  /*
   * Syscall return path ending with SYSRET (fast path)
 - * Has incomplete stack frame and undefined top of stack.
 + * Has incompletely filled pt_regs, iret frame is also incomplete.
   */
  ret_from_sys_call:
-       testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
-       jnz int_ret_from_sys_call       /* Go the slow path */
 +
        LOCKDEP_SYS_EXIT
        DISABLE_INTERRUPTS(CLBR_NONE)
        TRACE_IRQS_OFF
 -      testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
 -      jnz int_ret_from_sys_call_fixup /* Go the the slow path */
+       /*
+        * We must check ti flags with interrupts (or at least preemption)
+        * off because we must *never* return to userspace without
+        * processing exit work that is enqueued if we're preempted here.
+        * In particular, returning to userspace with any of the one-shot
+        * flags (TIF_NOTIFY_RESUME, TIF_USER_RETURN_NOTIFY, etc) set is
+        * very bad.
+        */
++      testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
++      jnz int_ret_from_sys_call_irqs_off      /* Go to the slow path */
        CFI_REMEMBER_STATE
        /*
         * sysretq will re-enable interrupts: