]> Pileus Git - ~andy/linux/blobdiff - arch/x86/kernel/entry_64.S
Merge commit 'linus/master' into tracing/kprobes
[~andy/linux] / arch / x86 / kernel / entry_64.S
index 681c3fda73916ff842566799a76cbd8bb0d138e1..42a0b2cbf2e12652c7ca0734565742a450793a14 100644 (file)
@@ -536,20 +536,13 @@ sysret_signal:
        bt $TIF_SYSCALL_AUDIT,%edx
        jc sysret_audit
 #endif
-       /* edx: work flags (arg3) */
-       leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
-       xorl %esi,%esi # oldset -> arg2
-       SAVE_REST
-       FIXUP_TOP_OF_STACK %r11
-       call do_notify_resume
-       RESTORE_TOP_OF_STACK %r11
-       RESTORE_REST
-       movl $_TIF_WORK_MASK,%edi
-       /* Use IRET because user could have changed frame. This
-          works because ptregscall_common has called FIXUP_TOP_OF_STACK. */
-       DISABLE_INTERRUPTS(CLBR_NONE)
-       TRACE_IRQS_OFF
-       jmp int_with_check
+       /*
+        * We have a signal, or exit tracing or single-step.
+        * These all wind up with the iret return path anyway,
+        * so just join that path right now.
+        */
+       FIXUP_TOP_OF_STACK %r11, -ARGOFFSET
+       jmp int_check_syscall_exit_work
 
 badsys:
        movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
@@ -654,6 +647,7 @@ int_careful:
 int_very_careful:
        TRACE_IRQS_ON
        ENABLE_INTERRUPTS(CLBR_NONE)
+int_check_syscall_exit_work:
        SAVE_REST
        /* Check for syscall exit trace */
        testl $_TIF_WORK_SYSCALL_EXIT,%edx
@@ -809,6 +803,10 @@ END(interrupt)
        call \func
        .endm
 
+/*
+ * Interrupt entry/exit should be protected against kprobes
+ */
+       .pushsection .kprobes.text, "ax"
        /*
         * The interrupt stubs push (~vector+0x80) onto the stack and
         * then jump to common_interrupt.
@@ -947,6 +945,10 @@ ENTRY(retint_kernel)
 
        CFI_ENDPROC
 END(common_interrupt)
+/*
+ * End of kprobes section
+ */
+       .popsection
 
 /*
  * APIC interrupts.