xtensa: check thread flags atomically on return from user exception

Check pending signals and rescheduling thread flags with interrupts
disabled, and don't enable them if no flags are set. Call
trace_hardirqs_on after thread flags handling, so that rescheduling is
done and hardirqs tracking flag is updated in the correct task context.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: enable kernel preemption

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP: xtensa: SMP clockevent

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: keep a3 and excsave1 on entry to exception handlers

Based on the SMP patch by Joe Taylor and subsequent fixes.
Preserve exception table pointer (normally stored in excsave1 SR) as it
cannot be easily restored in SMP environment.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: new fast_alloca handler

Instead of emulating movsp instruction in the kernel use window
underflow handler to load missing register window and retry failed
movsp.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: extract PIC into drivers/irqchip

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: add MX irqchip

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP: xtensa: add SMP support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP: xtensa: SMP update for TLB sanity checker

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP: xtensa: implement CPU hotplug

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: don't use echo -e needlessly

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP: xtensa: SMP debug on real LX200

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>