diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2015-03-30 14:09:31 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-31 03:31:11 -0400 |
commit | 627276cb55f33e2dc56eab5b973937c128b7704c (patch) | |
tree | f1e0a343d2a64d19841bdd83c30831db3bbbd863 /arch/x86/kernel/entry_64.S | |
parent | 4ee8ec17ba00fce4af042543771f996fb9d98d34 (diff) |
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>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r-- | arch/x86/kernel/entry_64.S | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index dbfc8875d735..34d60c34fca8 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -740,7 +740,19 @@ opportunistic_sysret_failed: | |||
740 | SWAPGS | 740 | SWAPGS |
741 | jmp restore_args | 741 | jmp restore_args |
742 | 742 | ||
743 | retint_restore_args: /* return to kernel space */ | 743 | /* Returning to kernel space */ |
744 | #ifdef CONFIG_PREEMPT | ||
745 | /* Interrupts are off */ | ||
746 | /* Check if we need preemption */ | ||
747 | ENTRY(retint_kernel) | ||
748 | cmpl $0,PER_CPU_VAR(__preempt_count) | ||
749 | jnz retint_restore_args | ||
750 | bt $9,EFLAGS(%rsp) /* interrupts were off? */ | ||
751 | jnc retint_restore_args | ||
752 | call preempt_schedule_irq | ||
753 | jmp exit_intr | ||
754 | #endif | ||
755 | retint_restore_args: | ||
744 | DISABLE_INTERRUPTS(CLBR_ANY) | 756 | DISABLE_INTERRUPTS(CLBR_ANY) |
745 | /* | 757 | /* |
746 | * The iretq could re-enable interrupts: | 758 | * The iretq could re-enable interrupts: |
@@ -830,17 +842,6 @@ retint_signal: | |||
830 | GET_THREAD_INFO(%rcx) | 842 | GET_THREAD_INFO(%rcx) |
831 | jmp retint_with_reschedule | 843 | jmp retint_with_reschedule |
832 | 844 | ||
833 | #ifdef CONFIG_PREEMPT | ||
834 | /* Returning to kernel space. Check if we need preemption */ | ||
835 | /* rcx: threadinfo. interrupts off. */ | ||
836 | ENTRY(retint_kernel) | ||
837 | cmpl $0,PER_CPU_VAR(__preempt_count) | ||
838 | jnz retint_restore_args | ||
839 | bt $9,EFLAGS(%rsp) /* interrupts off? */ | ||
840 | jnc retint_restore_args | ||
841 | call preempt_schedule_irq | ||
842 | jmp exit_intr | ||
843 | #endif | ||
844 | CFI_ENDPROC | 845 | CFI_ENDPROC |
845 | END(common_interrupt) | 846 | END(common_interrupt) |
846 | 847 | ||