aboutsummaryrefslogtreecommitdiff
path: root/arch/csky
AgeCommit message (Collapse)AuthorFilesLines
2018-12-31csky: basic ftrace supportedGuo Ren6-0/+64
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 Ren7-40/+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 Ren3-56/+41
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 Ren6-12/+86
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 Ren3-15/+69
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 Ren8-68/+79
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-31csky: fixup remove vdsp implement for kernel.Guo Ren1-7/+1
The vr regs for vdsp only saved in task_switch not in every exception trap-in. The memcpy with vdsp instructions will destroy the vr regs for user space applications. Signed-off-by: Guo Ren <[email protected]>
2018-12-31csky: bugfix gdb coredump error.Guo Ren1-1/+6
In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough for coredump and no need full sizeof(struct pt_regs). Signed-off-by: Guo Ren <[email protected]> Reported-by: Lu Baoquan <[email protected]> Reported-by: Liu Mao <[email protected]>
2018-12-31csky: fixup abiv2 mmap(... O_SYNC) failed.Guo Ren3-2/+3
Glibc function mmap(... O_SYNC) will make page to _PAGE_UNCACHE + _PAGE_SO and strong-order page couldn't support unalignment access. So remove _PAGE_SO from _PAGE_UNCACHE, also sync abiv1 with the macro of _PAGE_SO. Signed-off-by: Guo Ren <[email protected]> Reported-by: Liu Renwei <[email protected]> Tested-by: Yuan Qiyun <[email protected]>
2018-12-30csky: define syscall_get_arch()Dmitry V. Levin1-0/+7
syscall_get_arch() is required to be implemented on all architectures in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Cc: Guo Ren <[email protected]> Cc: Paul Moore <[email protected]> Cc: Eric Paris <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Elvira Khabirova <[email protected]> Cc: Eugene Syromyatnikov <[email protected]> Cc: [email protected] Signed-off-by: Dmitry V. Levin <[email protected]> Signed-off-by: Guo Ren <[email protected]> arch/csky/include/asm/syscall.h | 7 +++++++ include/uapi/linux/audit.h | 1 + 2 files changed, 8 insertions(+)
2018-12-30elf-em.h: add EM_CSKYDmitry V. Levin1-1/+1
The uapi/linux/audit.h header is going to use EM_CSKY in order to define AUDIT_ARCH_CSKY which is needed to implement syscall_get_arch() which in turn is required to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. The value for EM_CSKY has been taken from arch/csky/include/asm/elf.h and confirmed by binutils:include/elf/common.h Cc: Guo Ren <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Elvira Khabirova <[email protected]> Cc: Eugene Syromyatnikov <[email protected]> Signed-off-by: Dmitry V. Levin <[email protected]> Signed-off-by: Guo Ren <[email protected]>
2018-12-30csky: remove meaningless header-yMasahiro Yamada1-2/+0
Since commit fcc8487d477a ("uapi: export all headers under uapi directories"), header-y is meaningless because headers under uapi are all exported. Signed-off-by: Masahiro Yamada <[email protected]> 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-12-28Merge branch 'akpm' (patches from Andrew)Linus Torvalds1-2/+2
Merge misc updates from Andrew Morton: - large KASAN update to use arm's "software tag-based mode" - a few misc things - sh updates - ocfs2 updates - just about all of MM * emailed patches from Andrew Morton <[email protected]>: (167 commits) kernel/fork.c: mark 'stack_vm_area' with __maybe_unused memcg, oom: notify on oom killer invocation from the charge path mm, swap: fix swapoff with KSM pages include/linux/gfp.h: fix typo mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm hugetlbfs: Use i_mmap_rwsem to fix page fault/truncate race hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization memory_hotplug: add missing newlines to debugging output mm: remove __hugepage_set_anon_rmap() include/linux/vmstat.h: remove unused page state adjustment macro mm/page_alloc.c: allow error injection mm: migrate: drop unused argument of migrate_page_move_mapping() blkdev: avoid migration stalls for blkdev pages mm: migrate: provide buffer_migrate_page_norefs() mm: migrate: move migrate_page_lock_buffers() mm: migrate: lock buffers before migrate_page_move_mapping() mm: migration: factor out code to compute expected number of page references mm, page_alloc: enable pcpu_drain with zone capability kmemleak: add config to select auto scan mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init ...
2018-12-28Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mappingLinus Torvalds2-142/+3
Pull DMA mapping updates from Christoph Hellwig: "A huge update this time, but a lot of that is just consolidating or removing code: - provide a common DMA_MAPPING_ERROR definition and avoid indirect calls for dma_map_* error checking - use direct calls for the DMA direct mapping case, avoiding huge retpoline overhead for high performance workloads - merge the swiotlb dma_map_ops into dma-direct - provide a generic remapping DMA consistent allocator for architectures that have devices that perform DMA that is not cache coherent. Based on the existing arm64 implementation and also used for csky now. - improve the dma-debug infrastructure, including dynamic allocation of entries (Robin Murphy) - default to providing chaining scatterlist everywhere, with opt-outs for the few architectures (alpha, parisc, most arm32 variants) that can't cope with it - misc sparc32 dma-related cleanups - remove the dma_mark_clean arch hook used by swiotlb on ia64 and replace it with the generic noncoherent infrastructure - fix the return type of dma_set_max_seg_size (Niklas Söderlund) - move the dummy dma ops for not DMA capable devices from arm64 to common code (Robin Murphy) - ensure dma_alloc_coherent returns zeroed memory to avoid kernel data leaks through userspace. We already did this for most common architectures, but this ensures we do it everywhere. dma_zalloc_coherent has been deprecated and can hopefully be removed after -rc1 with a coccinelle script" * tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping: (73 commits) dma-mapping: fix inverted logic in dma_supported dma-mapping: deprecate dma_zalloc_coherent dma-mapping: zero memory returned from dma_alloc_* sparc/iommu: fix ->map_sg return value sparc/io-unit: fix ->map_sg return value arm64: default to the direct mapping in get_arch_dma_ops PCI: Remove unused attr variable in pci_dma_configure ia64: only select ARCH_HAS_DMA_COHERENT_TO_PFN if swiotlb is enabled dma-mapping: bypass indirect calls for dma-direct vmd: use the proper dma_* APIs instead of direct methods calls dma-direct: merge swiotlb_dma_ops into the dma_direct code dma-direct: use dma_direct_map_page to implement dma_direct_map_sg dma-direct: improve addressability error reporting swiotlb: remove dma_mark_clean swiotlb: remove SWIOTLB_MAP_ERROR ACPI / scan: Refactor _CCA enforcement dma-mapping: factor out dummy DMA ops dma-mapping: always build the direct mapping code dma-mapping: move dma_cache_sync out of line dma-mapping: move various slow path functions out of line ...
2018-12-28mm: convert totalram_pages and totalhigh_pages variables to atomicArun KS1-2/+2
totalram_pages and totalhigh_pages are made static inline function. Main motivation was that managed_page_count_lock handling was complicating things. It was discussed in length here, https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes better to remove the lock and convert variables to atomic, with preventing poteintial store-to-read tearing as a bonus. [[email protected]: coding style fixes] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arun KS <[email protected]> Suggested-by: Michal Hocko <[email protected]> Suggested-by: Vlastimil Babka <[email protected]> Reviewed-by: Konstantin Khlebnikov <[email protected]> Reviewed-by: Pavel Tatashin <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2018-12-13dma-mapping: always build the direct mapping codeChristoph Hellwig1-1/+0
All architectures except for sparc64 use the dma-direct code in some form, and even for sparc64 we had the discussion of a direct mapping mode a while ago. In preparation for directly calling the direct mapping code don't bother having it optionally but always build the code in. This is a minor hardship for some powerpc and arm configs that don't pull it in yet (although they should in a relase ot two), and sparc64 which currently doesn't need it at all, but it will reduce the ifdef mess we'd otherwise need significantly. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Jesper Dangaard Brouer <[email protected]> Tested-by: Jesper Dangaard Brouer <[email protected]> Tested-by: Tony Luck <[email protected]>
2018-12-03csky: bugfix tlb_get_pgd error.Guo Ren1-2/+2
It's wrong to mask/unmask highest bit in addr to translate the vaddr to paddr. We should use PAGE_OFFSET and PHYS_OFFSET. Wrong implement: return ((get_pgd()|(1<<31)) - PHYS_OFFSET) & ~1; When PHYS_OFFSET=0xc0000000 and get_pgd() return 0xe0000000, it'll return 0x60000000. It's wrong and should be 0xa0000000. Now correct it to: return ((get_pgd() - PHYS_OFFSET) & ~1) + PAGE_OFFSET; Signed-off-by: Guo Ren <[email protected]>
2018-12-01csky: use the generic remapping dma alloc implementationChristoph Hellwig2-141/+3
The csky code was largely copied from arm/arm64, so switch to the generic arm64-based implementation instead. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Guo Ren <[email protected]>
2018-12-01csky: don't use GFP_DMA in atomic_pool_initChristoph Hellwig1-1/+1
csky does not implement ZONE_DMA, which means passing GFP_DMA is a no-op. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Guo Ren <[email protected]>
2018-12-01csky: don't select DMA_NONCOHERENT_OPSChristoph Hellwig1-1/+0
This option is gone past Linux 4.19. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Guo Ren <[email protected]>
2018-12-01dma-mapping: move the remap helpers to a separate fileChristoph Hellwig1-0/+1
The dma remap code only makes sense for not cache coherent architectures (or possibly the corner case of highmem CMA allocations) and currently is only used by arm, arm64, csky and xtensa. Split it out into a separate file with a separate Kconfig symbol, which gets the right copyright notice given that this code was written by Laura Abbott working for Code Aurora at that point. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Laura Abbott <[email protected]> Reviewed-by: Robin Murphy <[email protected]>
2018-11-01Merge tag 'csky-for-linus-4.20-fixup-dtb' of https://github.com/c-sky/csky-linuxLinus Torvalds3-31/+2
Pull csky dtb fixups from Guo Ren: "These fix the csky dtb Kbuild to follow the new Devicetree dtb build rules" * tag 'csky-for-linus-4.20-fixup-dtb' of https://github.com/c-sky/csky-linux: csky: use common dtb build rules csky: remove builtin-dtb Kbuild
2018-11-01csky: use common dtb build rulesGuo Ren2-13/+1
Remove the Kbuild rules in arch/csky and use common dtb build rules. This modification is based on: commit 37c8a5fafa3b ("kbuild: consolidate Devicetree dtb build rules") Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Rob Herring <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2018-11-01csky: remove builtin-dtb KbuildGuo Ren3-18/+1
Remove the builtin-dtb implementation in arch/csky. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-31mm: remove CONFIG_HAVE_MEMBLOCKMike Rapoport4-6/+3
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-31mm: remove CONFIG_NO_BOOTMEMMike Rapoport1-1/+0
All achitectures select NO_BOOTMEM which essentially becomes 'Y' for any kernel configuration and therefore it can be removed. [[email protected]: remove now defunct NO_BOOTMEM from depends list for deferred init] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Alexander Duyck <[email protected]> Acked-by: Michal Hocko <[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-31treewide: remove current_text_addrNick Desaulniers1-6/+0
Prefer _THIS_IP_ defined in linux/kernel.h. Most definitions of current_text_addr were the same as _THIS_IP_, but a few archs had inline assembly instead. This patch removes the final call site of current_text_addr, making all of the definitions dead code. [[email protected]: fix arch/csky/include/asm/processor.h] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Nick Desaulniers <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2018-10-26csky: Misc headersGuo Ren9-0/+351
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 Ren2-0/+263
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 Ren4-0/+510
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: User accessGuo Ren2-0/+678
The patch adds "user access from kernel" codes. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-26csky: Library functionsGuo Ren19-0/+1420
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 Ren4-0/+246
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 Ren5-0/+665
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 Ren2-0/+71
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 Ren4-0/+138
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 Ren10-0/+1231
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: MMU and page table managementGuo Ren20-0/+1620
This patch adds files related to memory management and here is our memory-layout: Fixmap : 0xffc02000 – 0xfffff000 (4 MB - 12KB) Pkmap : 0xff800000 – 0xffc00000 (4 MB) Vmalloc : 0xf0200000 – 0xff000000 (238 MB) Lowmem : 0x80000000 – 0xc0000000 (1GB) abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem. abiv2 CPUs are all PIPT cache and they could support highmem. Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup memory page table for it. Link:https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Guo Ren <[email protected]> Cc: Christoph Hellwig <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-25csky: Cache and TLB routinesGuo Ren15-0/+838
This patch adds cache and tlb sync codes for abiv1 & abiv2. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-25csky: System CallGuo Ren5-0/+153
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 Ren9-0/+1546
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: defconfigGuo Ren1-0/+61
This patch adds csky defconfig. Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
2018-10-25csky: Build infrastructureGuo Ren13-0/+466
This patch adds Makefile, Kconfig for build infrastructure. Signed-off-by: Guo Ren <[email protected]> Acked-by: Arnd Bergmann <[email protected]>