Message ID | 20151221113021.GH23092@arm.com |
---|---|
State | New |
Headers | show |
On Mon, Dec 21, 2015 at 12:19:32PM +0000, James Morse wrote: > Will Deacon wrote: > >> > + mrs x26, sp_el0 // already masked > >> > >> Nit: How about using 'get_thread_info x26'? > > > > Something like the following? > > Looks fine - I guess you're cleverly leaving the the el0_irq case to be > covered by get_thread_info in kernel_entry? Yup. tsk is always valid for exceptions taken from el0, afaict. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 6745a9041f99..c0db321db7e1 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -182,12 +182,12 @@ alternative_endif mov x19, sp // preserve the original sp /* - * Compare sp and sp_el0, if the top ~(THREAD_SIZE - 1) bits match, - * we are on a task stack, and should switch to the irq stack. + * Compare sp with the current thread_info, if the top + * ~(THREAD_SIZE - 1) bits match, we are on a task stack, and + * should switch to the irq stack. */ - mrs x26, sp_el0 // already masked and x25, x19, #~(THREAD_SIZE - 1) - cmp x25, x26 + cmp x25, tsk b.ne 9998f this_cpu_ptr irq_stack, x25, x26 @@ -406,10 +406,10 @@ el1_irq: bl trace_hardirqs_off #endif + get_thread_info tsk irq_handler #ifdef CONFIG_PREEMPT - get_thread_info tsk ldr w24, [tsk, #TI_PREEMPT] // get preempt count cbnz w24, 1f // preempt count != 0 ldr x0, [tsk, #TI_FLAGS] // get flags