Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1171036
| Path | csiph.com!aioe.org!news.mixmin.net!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Andy Lutomirski <luto@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 12/15] x86/asm/entry/64: Migrate error and interrupt exit work to C |
| Date | Wed, 24 Jun 2015 04:50:01 +0200 |
| Message-ID | <pEIVb-554-1@gated-at.bofh.it> (permalink) |
| References | <pEIVb-554-3@gated-at.bofh.it> |
| X-Original-To | x86@kernel.org, linux-kernel@vger.kernel.org |
| X-Mailer | git-send-email 2.4.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 112 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Frédéric Weisbecker <fweisbec@gmail.com>, Rik van Riel <riel@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Denys Vlasenko <vda.linux@googlemail.com>, Borislav Petkov <bp@alien8.de>, Kees Cook <keescook@chromium.org>, Brian Gerst <brgerst@gmail.com>, paulmck@linux.vnet.ibm.com, Andy Lutomirski <luto@kernel.org> |
| X-Original-Date | Tue, 23 Jun 2015 19:46:15 -0700 |
| X-Original-Message-ID | <4d7bbc54d7a0aff0430759fda2364a847305f9a0.1435113808.git.luto@kernel.org> |
| X-Original-References | <cover.1435113808.git.luto@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1171036 |
Show key headers only | View raw
Signed-off-by: Andy Lutomirski <luto@kernel.org> --- arch/x86/entry/entry_64.S | 63 +++++++++++++---------------------------------- 1 file changed, 17 insertions(+), 46 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index ce2d10933c11..e87d6259dd2c 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -507,7 +507,16 @@ END(irq_entries_start) testb $3, CS(%rsp) jz 1f + + /* + * IRQ from user mode. Switch to kernel gsbase and inform context + * tracking that we're in kernel mode. + */ SWAPGS +#ifdef CONFIG_CONTEXT_TRACKING + call enter_from_user_mode +#endif + 1: /* * Save previous stack pointer, optionally switch to interrupt stack. @@ -546,26 +555,13 @@ ret_from_intr: testb $3, CS(%rsp) jz retint_kernel - /* Interrupt came from user space */ -retint_user: - GET_THREAD_INFO(%rcx) - /* %rcx: thread info. Interrupts are off. */ -retint_with_reschedule: - movl $_TIF_WORK_MASK, %edi -retint_check: + /* Interrupt came from user space */ LOCKDEP_SYS_EXIT_IRQ - movl TI_flags(%rcx), %edx - andl %edi, %edx - jnz retint_careful - -retint_swapgs: /* return to user-space */ - /* - * The iretq could re-enable interrupts: - */ - DISABLE_INTERRUPTS(CLBR_ANY) +retint_user: + mov %rsp,%rdi + call prepare_exit_to_usermode TRACE_IRQS_IRETQ - SWAPGS jmp restore_regs_and_iret @@ -643,35 +639,6 @@ native_irq_return_ldt: popq %rax jmp native_irq_return_iret #endif - - /* edi: workmask, edx: work */ -retint_careful: - bt $TIF_NEED_RESCHED, %edx - jnc retint_signal - TRACE_IRQS_ON - ENABLE_INTERRUPTS(CLBR_NONE) - pushq %rdi - SCHEDULE_USER - popq %rdi - GET_THREAD_INFO(%rcx) - DISABLE_INTERRUPTS(CLBR_NONE) - TRACE_IRQS_OFF - jmp retint_check - -retint_signal: - testl $_TIF_DO_NOTIFY_MASK, %edx - jz retint_swapgs - TRACE_IRQS_ON - ENABLE_INTERRUPTS(CLBR_NONE) - movq $-1, ORIG_RAX(%rsp) - xorl %esi, %esi /* oldset */ - movq %rsp, %rdi /* &pt_regs */ - call do_notify_resume - DISABLE_INTERRUPTS(CLBR_NONE) - TRACE_IRQS_OFF - GET_THREAD_INFO(%rcx) - jmp retint_with_reschedule - END(common_interrupt) /* @@ -1087,6 +1054,10 @@ error_entry_from_usermode_swapgs: SWAPGS error_entry_from_usermode_after_swapgs: +#ifdef CONFIG_CONTEXT_TRACKING + call enter_from_user_mode +#endif + error_entry_done: TRACE_IRQS_OFF ret -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v3 12/15] x86/asm/entry/64: Migrate error and interrupt exit work to C Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200
csiph-web