x86/asm/entry/64: Move retint_kernel code block closer to its user

The "retint_kernel" code block is misplaced. Since its logical
continuation is "retint_restore_args", it is more natural to
place it above that label. This also makes two jumps "short".

This change only moves code block around, without changing
logic.

This enables the next simplification: making
"retint_restore_args" label a local numeric one.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Will Drewry <wad@chromium.org>
Link: http://lkml.kernel.org/r/1427738975-7391-2-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Denys Vlasenko 2015-03-30 20:09:31 +02:00 committed by Ingo Molnar
parent 4ee8ec17ba
commit 627276cb55

View file

@ -740,7 +740,19 @@ opportunistic_sysret_failed:
SWAPGS SWAPGS
jmp restore_args jmp restore_args
retint_restore_args: /* return to kernel space */ /* Returning to kernel space */
#ifdef CONFIG_PREEMPT
/* Interrupts are off */
/* Check if we need preemption */
ENTRY(retint_kernel)
cmpl $0,PER_CPU_VAR(__preempt_count)
jnz retint_restore_args
bt $9,EFLAGS(%rsp) /* interrupts were off? */
jnc retint_restore_args
call preempt_schedule_irq
jmp exit_intr
#endif
retint_restore_args:
DISABLE_INTERRUPTS(CLBR_ANY) DISABLE_INTERRUPTS(CLBR_ANY)
/* /*
* The iretq could re-enable interrupts: * The iretq could re-enable interrupts:
@ -830,17 +842,6 @@ retint_signal:
GET_THREAD_INFO(%rcx) GET_THREAD_INFO(%rcx)
jmp retint_with_reschedule jmp retint_with_reschedule
#ifdef CONFIG_PREEMPT
/* Returning to kernel space. Check if we need preemption */
/* rcx: threadinfo. interrupts off. */
ENTRY(retint_kernel)
cmpl $0,PER_CPU_VAR(__preempt_count)
jnz retint_restore_args
bt $9,EFLAGS(%rsp) /* interrupts off? */
jnc retint_restore_args
call preempt_schedule_irq
jmp exit_intr
#endif
CFI_ENDPROC CFI_ENDPROC
END(common_interrupt) END(common_interrupt)