Hello,
this series does a bunch of small cleanups around exception and
coprocessor handling code and adds coprocessors support in SMP
configurations.
Changes v1->v2:
- clean up exception handler prototypes
- merge SAVE_CP_REGS_TAB and LOAD_CP_REGS_TAB
- get rid of stack frame in coprocessor_flush
- document rules for coprocessor context management
- clean up context management from the LKMM point of view, introduce
and document barriers
- support CPU hotplug
Max Filippov (10):
xtensa: clean up function declarations in traps.c
xtensa: clean up exception handler prototypes
xtensa: clean up declarations in coprocessor.h
xtensa: clean up excsave1 initialization
xtensa: use callx0 opcode in fast_coprocessor
xtensa: handle coprocessor exceptions in kernel mode
xtensa: add xtensa_xsr macro
xtensa: merge SAVE_CP_REGS_TAB and LOAD_CP_REGS_TAB
xtensa: get rid of stack frame in coprocessor_flush
xtensa: support coprocessors on SMP
arch/xtensa/include/asm/coprocessor.h | 11 +-
arch/xtensa/include/asm/processor.h | 7 +
arch/xtensa/include/asm/thread_info.h | 7 +-
arch/xtensa/include/asm/traps.h | 40 +++--
arch/xtensa/kernel/asm-offsets.c | 8 +-
arch/xtensa/kernel/coprocessor.S | 230 +++++++++++++++-----------
arch/xtensa/kernel/entry.S | 12 +-
arch/xtensa/kernel/process.c | 112 ++++++++++---
arch/xtensa/kernel/ptrace.c | 3 +-
arch/xtensa/kernel/s32c1i_selftest.c | 7 +-
arch/xtensa/kernel/signal.c | 3 +-
arch/xtensa/kernel/smp.c | 7 +
arch/xtensa/kernel/traps.c | 69 ++++----
13 files changed, 334 insertions(+), 182 deletions(-)
--
2.30.2
Use xtensa_set_sr instead of inline assembly.
Rename local variable exc_table in early_trap_init to avoid conflict
with per-CPU variable of the same name.
Signed-off-by: Max Filippov <[email protected]>
---
arch/xtensa/include/asm/traps.h | 4 ++--
arch/xtensa/kernel/traps.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/xtensa/include/asm/traps.h b/arch/xtensa/include/asm/traps.h
index bfdb0af61b07..514376eff58c 100644
--- a/arch/xtensa/include/asm/traps.h
+++ b/arch/xtensa/include/asm/traps.h
@@ -57,11 +57,11 @@ void do_unhandled(struct pt_regs *regs);
/* Initialize minimal exc_table structure sufficient for basic paging */
static inline void __init early_trap_init(void)
{
- static struct exc_table exc_table __initdata = {
+ static struct exc_table init_exc_table __initdata = {
.fast_kernel_handler[EXCCAUSE_DTLB_MISS] =
fast_second_level_miss,
};
- __asm__ __volatile__("wsr %0, excsave1\n" : : "a" (&exc_table));
+ xtensa_set_sr(&init_exc_table, excsave1);
}
void secondary_trap_init(void);
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index d6b1a0c3e319..95903f25e523 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -372,8 +372,7 @@ __init trap_set_handler(int cause, xtensa_exception_handler *handler)
static void trap_init_excsave(void)
{
- unsigned long excsave1 = (unsigned long)this_cpu_ptr(&exc_table);
- __asm__ __volatile__("wsr %0, excsave1\n" : : "a" (excsave1));
+ xtensa_set_sr(this_cpu_ptr(&exc_table), excsave1);
}
static void trap_init_debug(void)
--
2.30.2