aboutsummaryrefslogtreecommitdiff
path: root/arch/csky/kernel
AgeCommit message (Collapse)AuthorFilesLines
2019-02-13csky: Fixup wrong pt_regs sizeGuo Ren1-1/+2
The bug is from commit 2054f4af1957 ("csky: bugfix gdb coredump error.") We change the ELF_NGREG to ELF_NGREG - 2 to fit gdb&gcc define, but forgot modify ptrace regset. Now coredump use ELF_NRGEG to parse GPRs and ptrace use pt_regs_regset, so there are two different reg_sets for userspace. Signed-off-by: Guo Ren <[email protected]>
2019-01-10csky: fixup compile error with CPU 810.Guo Ren1-1/+1
This bug is from commit f553aa1c13cb ("csky: fixup relocation error with 807 & 860"). I forgot to compile with 810 for that patch. Signed-off-by: Guo Ren <[email protected]> Cc: Arnd Bergmann <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2019-01-08csky: fixup relocation error with 807 & 860Guo Ren1-16/+22
810 doesn't support jsri instruction and csky-as will leave jsri + nop for relocation. Module-probe need replace them with lrw + jsr. Signed-off-by: Guo Ren <[email protected]> Cc: Hui Kai <[email protected]>
2019-01-05Merge tag 'csky-for-linus-4.21' of git://github.com/c-sky/csky-linuxLinus Torvalds12-144/+1265
Pull arch/csky updates from Guo Ren: "Here are three main features (cpu_hotplug, basic ftrace, basic perf) and some bugfixes: Features: - Add CPU-hotplug support for SMP - Add ftrace with function trace and function graph trace - Add Perf support - Add EM_CSKY_OLD 39 - optimize kernel panic print. - remove syscall_exit_work Bugfixes: - fix abiv2 mmap(... O_SYNC) failure - fix gdb coredump error - remove vdsp implement for kernel - fix qemu failure to bootup sometimes - fix ftrace call-graph panic - fix device tree node reference leak - remove meaningless header-y - fix save hi,lo,dspcr regs in switch_stack - remove unused members in processor.h" * tag 'csky-for-linus-4.21' of git://github.com/c-sky/csky-linux: csky: Add perf support for C-SKY csky: Add EM_CSKY_OLD 39 clocksource/drivers/c-sky: fixup ftrace call-graph panic csky: ftrace call graph supported. csky: basic ftrace supported csky: remove unused members in processor.h csky: optimize kernel panic print. csky: stacktrace supported. csky: CPU-hotplug supported for SMP clocksource/drivers/c-sky: fixup qemu fail to bootup sometimes. csky: fixup save hi,lo,dspcr regs in switch_stack. csky: remove syscall_exit_work csky: fixup remove vdsp implement for kernel. csky: bugfix gdb coredump error. csky: fixup abiv2 mmap(... O_SYNC) failed. csky: define syscall_get_arch() elf-em.h: add EM_CSKY csky: remove meaningless header-y csky: Don't leak device tree node reference
2019-01-03Remove 'type' argument from access_ok() functionLinus Torvalds1-1/+1
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument of the user address range verification function since we got rid of the old racy i386-only code to walk page tables by hand. It existed because the original 80386 would not honor the write protect bit when in kernel mode, so you had to do COW by hand before doing any user access. But we haven't supported that in a long time, and these days the 'type' argument is a purely historical artifact. A discussion about extending 'user_access_begin()' to do the range checking resulted this patch, because there is no way we're going to move the old VERIFY_xyz interface to that model. And it's best done at the end of the merge window when I've done most of my merges, so let's just get this done once and for all. This patch was mostly done with a sed-script, with manual fix-ups for the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form. There were a couple of notable cases: - csky still had the old "verify_area()" name as an alias. - the iter_iov code had magical hardcoded knowledge of the actual values of VERIFY_{READ,WRITE} (not that they mattered, since nothing really used it) - microblaze used the type argument for a debug printout but other than those oddities this should be a total no-op patch. I tried to fix up all architectures, did fairly extensive grepping for access_ok() uses, and the changes are trivial, but I may have missed something. Any missed conversion should be trivially fixable, though. Signed-off-by: Linus Torvalds <[email protected]>
2019-01-02csky: Add perf support for C-SKYGuo Ren2-0/+1032
This adds basic perf support for all C-SKY CPUs. Hardware events are only supported by 807/810/860. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: ftrace call graph supported.Guo Ren1-11/+37
With csky-gcc -pg -mbacktrace, ftrace call graph supported. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: basic ftrace supportedGuo Ren2-0/+29
When gcc with -pg, it'll add _mcount stub in every function. We need implement the _mcount in kernel and ftrace depends on stackstrace. To do: call-graph, dynamic ftrace Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: remove unused members in processor.hGuo Ren5-25/+0
Cleanup struct cpuinfo_csky and struct thread_struct, remove all esp0 related code. We could get pt_regs from sp and backtrace could use fp in switch_stack. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: optimize kernel panic print.Guo Ren2-54/+39
Use STACKTRACE to optimize panic print more pretty and align registers printing. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: stacktrace supported.Guo Ren3-12/+75
The gcc option "-mbacktrace" will push fp(r8),lr into stack and we could unwind the stack with: fp = *fp lr = (unsigned int *)fp[1] Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: CPU-hotplug supported for SMPGuo Ren1-15/+56
This is a simple implement of CPU-hotplug for power saving. CPU use wait instruction to enter power saving mode and waiting for IPI wakeup signal. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: fixup save hi,lo,dspcr regs in switch_stack.Guo Ren3-25/+3
HI, LO, DSPCR registers are 807/810 related regs and no need for 610/860. All of the regs must be saved in pt_regs and switch_stack. This patch fixup saving dspcr reg in switch_stack and pt_regs. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: remove syscall_exit_workGuo Ren1-12/+4
Remove syscall_exit_work and union all to ret_from_exception. Signed-off-by: Guo Ren <[email protected]>
2018-12-30csky: Don't leak device tree node referenceYangtao Li1-1/+1
of_find_node_by_type() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. setup_smp() doesn't do that, so fix it by converting to for_each_of_cpu_node(). Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Guo Ren <[email protected]>
2018-10-31mm: remove CONFIG_HAVE_MEMBLOCKMike Rapoport1-1/+0
All architecures use memblock for early memory management. There is no need for the CONFIG_HAVE_MEMBLOCK configuration option. [[email protected]: of/fdt: fixup #ifdefs] Link: http://lkml.kernel.org/r/20180919103457.GA20545@rapoport-lnx [[email protected]: csky: fixups after bootmem removal] Link: http://lkml.kernel.org/r/20180926112744.GC4628@rapoport-lnx [[email protected]: remove stale #else and the code it protects] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Acked-by: Michal Hocko <[email protected]> Tested-by: Jonathan Cameron <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chris Zankel <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Greentime Hu <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Ley Foon Tan <[email protected]> Cc: Mark Salter <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Michal Simek <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Burton <[email protected]> Cc: Richard Kuo <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Rich Felker <[email protected]> Cc: Russell King <[email protected]> Cc: Serge Semin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Tony Luck <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Yoshinori Sato <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2018-10-26csky: Misc headersGuo Ren1-0/+88
This patch adds csky registers' definition, bitops, byteorder, asm-offsets codes. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: SMP supportGuo Ren1-0/+237
This patch adds boot, ipi, hotplug codes for SMP. Signed-off-by: Guo Ren <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: Debug and Ptrace GDBGuo Ren2-0/+380
This patch adds arch ptrace implementation, stack dump and bug.h. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: Library functionsGuo Ren1-0/+30
This patch adds string optimize codes and some auxiliary codes. Signed-off-by: Chen Linfei <[email protected]> Signed-off-by: Mao Han <[email protected]> Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: ELF and module probeGuo Ren1-0/+92
This patch adds ELF definition and module relocate codes. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: Atomic operationsGuo Ren1-0/+87
This patch adds atomic, cmpxchg, spinlock files. Signed-off-by: Guo Ren <[email protected]> Cc: Andrea Parri <[email protected]> Cc: Arnd Bergmann <[email protected]> Reviewed-by: Peter Zijlstra <[email protected]>
2018-10-26csky: IRQ handlingGuo Ren1-0/+22
This patch adds IRQ handling files. Signed-off-by: Guo Ren <[email protected]> Cc: Thomas Gleixner <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: VDSO and rt_sigreturnGuo Ren1-0/+86
This patch adds files related to VDSO and our VDSO only support rt_sigreturn. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: Process management and SignalGuo Ren3-0/+494
This patch adds files related to task_switch, sigcontext, signal, fpu context switch. Signed-off-by: Guo Ren <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Eric W. Biederman <[email protected]>
2018-10-25csky: System CallGuo Ren2-0/+57
This patch adds files related to syscall. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-25csky: Exception handling and mm-faultGuo Ren3-0/+644
This patch adds exception handling code, cpuinfo and mm-fault code. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-25csky: Kernel bootingGuo Ren3-0/+305
This patch add boot code. Thx boot params is all in dtb and it's the only way to let kernel get bootloader param information. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-25csky: Build infrastructureGuo Ren1-0/+8
This patch adds Makefile, Kconfig for build infrastructure. Signed-off-by: Guo Ren <[email protected]> Acked-by: Arnd Bergmann <[email protected]>