Merge branch 'tip/x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / entry_64.S
index 2de3e457bd4b85c14a89fdba9bd9c95908d88903..a63dabe153caa24d9611c54bf11e4b041d380e0a 100644 (file)
@@ -320,7 +320,7 @@ ENDPROC(native_usergs_sysret64)
        movq %rsp, %rsi
 
        leaq -RBP(%rsp),%rdi    /* arg1 for handler */
-       testl $3, CS(%rdi)
+       testl $3, CS-RBP(%rsi)
        je 1f
        SWAPGS
        /*
@@ -330,11 +330,10 @@ ENDPROC(native_usergs_sysret64)
         * moving irq_enter into assembly, which would be too much work)
         */
 1:     incl PER_CPU_VAR(irq_count)
-       jne 2f
-       mov PER_CPU_VAR(irq_stack_ptr),%rsp
+       cmovzq PER_CPU_VAR(irq_stack_ptr),%rsp
        CFI_DEF_CFA_REGISTER    rsi
 
-2:     /* Store previous stack value */
+       /* Store previous stack value */
        pushq %rsi
        CFI_ESCAPE      0x0f /* DW_CFA_def_cfa_expression */, 6, \
                        0x77 /* DW_OP_breg7 */, 0, \