diff options
author | Helge Deller <deller@gmx.de> | 2022-01-07 16:05:11 +0300 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-01-11 13:57:37 +0300 |
commit | d6ab9fc74513ae6501afcdae2547334a03b9a5c9 (patch) | |
tree | f0132160962fd195b75515e5ba0a5ef266085b6c /arch/parisc/kernel/toc_asm.S | |
parent | 6968e707d371ef80511448c6771daf445b4a5cf5 (diff) | |
download | linux-d6ab9fc74513ae6501afcdae2547334a03b9a5c9.tar.xz |
parisc: Enable TOC (transfer of contents) feature unconditionally
Before this patch, the TOC code used a pre-allocated stack of 16kb for
each possible CPU. That space overhead was the reason why the TOC
feature wasn't enabled by default for 32-bit kernels.
This patch rewrites the TOC code to use a per-cpu stack. That way we use
much less memory now and as such we enable the TOC feature by default on
all kernels.
Additionally the dump of the registers and the stacktrace wasn't
serialized, which led to multiple CPUs printing the stack backtrace at
once which rendered the output unreadable.
Now the backtraces are nicely serialized by a lock.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/kernel/toc_asm.S')
-rw-r--r-- | arch/parisc/kernel/toc_asm.S | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/arch/parisc/kernel/toc_asm.S b/arch/parisc/kernel/toc_asm.S index e94ba8044190..570f5cef526e 100644 --- a/arch/parisc/kernel/toc_asm.S +++ b/arch/parisc/kernel/toc_asm.S @@ -5,34 +5,25 @@ .level 1.1 #include <asm/assembly.h> -#include <asm/psw.h> #include <linux/threads.h> #include <linux/linkage.h> .text .import toc_intr,code - .import toc_lock,data + .import toc_stack,data .align 16 ENTRY_CFI(toc_handler) - /* - * synchronize CPUs and obtain offset - * for stack setup. - */ - load32 PA(toc_lock),%r1 -0: ldcw,co 0(%r1),%r2 - cmpib,= 0,%r2,0b - nop - addi 1,%r2,%r4 - stw %r4,0(%r1) - addi -1,%r2,%r4 - load32 PA(toc_stack),%sp - /* - * deposit CPU number into stack address, - * so every CPU will have its own stack. - */ - SHLREG %r4,14,%r4 + +#ifdef CONFIG_SMP + /* get per-cpu toc_stack address. */ + mfctl %cr30, %r1 + tophys %r1,%r2 /* task_struct */ + LDREG TASK_TI_CPU(%r2),%r4 /* cpu */ + load32 PA(__per_cpu_offset),%r1 + LDREGX %r4(%r1),%r4 add %r4,%sp,%sp +#endif /* * setup pt_regs on stack and save the @@ -82,7 +73,3 @@ ENDPROC_CFI(toc_handler) */ SYM_DATA(toc_handler_csum, .long 0) SYM_DATA(toc_handler_size, .long . - toc_handler) - - __PAGE_ALIGNED_BSS - .align 64 -SYM_DATA(toc_stack, .block 16384*NR_CPUS) |