1. 22 Apr, 2019 12 commits
    • Mao Han's avatar
      csky: Add perf_arch_fetch_caller_regs support · b4bf2741
      Mao Han authored
      In trace events as tracepoints context are not able to
      be retrieve with task_pt_regs. Without arch caller regs
      support the pt_regs context will be all zero, perf can
      not parsing the callchain and resolving the symbols
      correctly, some time will even get into deadlock
      while handling the page fault, eg:
      
      perf kmem —page record ls
      
      Changelog
       - Add test case cmd in comment
       - Use regs_fp(regs) which is defined in abi/regdef.h
      Signed-off-by: default avatarMao Han <han_mao@c-sky.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      b4bf2741
    • Guo Ren's avatar
      csky: Fixup wrong update_mmu_cache implementation · 981bbf27
      Guo Ren authored
      In our stress test, we found some crash problem caused by:
      
      if (!(vma->vm_flags & VM_EXEC))
      	return;
      
      in update_mmu_cache().
      
      Seems current update_mmu_cache implementation is wrong and we retread
      to the conservative implementation.
      
      Also the usage of kmap_atomic in update_mmu_cache is risky, page-virtual
      may be scheduled out and changed, so we must use preempt_disable &
      pagefault_disable which is called by kmap_atomic().
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      981bbf27
    • Guo Ren's avatar
      csky: Support dynamic start physical address · f62e3162
      Guo Ren authored
      Before this patch csky-linux need CONFIG_RAM_BASE to determine start
      physical address. Now we use phys_offset variable to replace the macro
      of PHYS_OFFSET and we setup phys_offset with real physical address which
      is determined during startup in head.S.
      
      With this patch we needn't re-compile kernel for different start
      physical address. ie: 0x0 / 0xc0000000 start physical address could use
      the same vmlinux, be care different start address must be 512MB aligned.
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      f62e3162
    • Guo Ren's avatar
      csky: Reconstruct signal processing · bf241682
      Guo Ren authored
      Linux kernel has provided some apis for arch signal's implementation.
      For example:
      	restore_saved_sigmask()
      	set_current_blocked()
      	restore_altstack()
      
      But in last version of csky signal.c didn't use them and some codes are
      confusing, so reconstruct signal.c with reference to riscv's code.
      
      Now csky signal.c implementation are very close to riscv and we can
      get the following benefits:
       - Clear code structure
       - The signal code of riscv and csky can be reviewed together
       - Promoting the unification of arch's signal implementation
      
      Also modified the related code in entry.S
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      bf241682
    • Guo Ren's avatar
      csky: Use in_syscall & forget_syscall instead of r11_sig · f4625ee0
      Guo Ren authored
      We could use regs->sr 16-24 bits to detect syscall: VEC_TRAP0 and
      r11_sig is no necessary for current implementation.
      
      In this patch, we implement the in_syscall and forget_syscall which are
      inspired from arm & nds32, but csky pt_regs has no syscall_num element
      and we just set zero to regs->sr's vector-bits-field instead.
      
      For ret_from_fork, current task was forked from parent which is in syscall
      progress and its regs->sr has been already setted with VEC_TRAP0. See:
      arch/csky/kernel/process.c: copy_thread()
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      f4625ee0
    • Guo Ren's avatar
      csky: Add non-uapi asm/ptrace.h namespace · f335b10f
      Guo Ren authored
      Move #ifdef __KERNEL__ code in the uapi namespace to non-uapi
      include/asm/ptrace.h namespace and remove #ifdef __KERNEL__ in
      include/asm/ptrace.h. Seperate ptrace.h in uapi and non-uapi is more
      common and clear.
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Dmitry V. Levin <ldv@altlinux.org>
      f335b10f
    • Jagadeesh Pagadala's avatar
      csky: mm/fault.c: Remove duplicate header · ce63cd5b
      Jagadeesh Pagadala authored
      Remove duplicate header which is included twice.
      Signed-off-by: default avatarJagadeesh Pagadala <jagdsh.linux@gmail.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      ce63cd5b
    • Masahiro Yamada's avatar
      csky: remove redundant generic-y · 1b2707fb
      Masahiro Yamada authored
      Since commit 7cbbbb8b ("kbuild: warn redundant generic-y"),
      redundant generic-y is reported. I missed to delete this one.
      
      scripts/Makefile.asm-generic:25: redundant generic-y found in arch/csky/include/asm/Kbuild: ftrace.h
      
      In this case, csky-specific implementation exists in
      arch/csky/include/asm/ftrace.h
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      1b2707fb
    • Guo Ren's avatar
      csky: Update syscall_trace_enter/exit implementation · 2f7932b0
      Guo Ren authored
      Previous syscall_trace implementation couldn't support AUDITSYSCALL and
      SYSCALL_TRACEPOINTS. Now we redesign it to support audit_syscall
      and syscall_tracepoints just like other archs'.
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Dmitry V. Levin <ldv@altlinux.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      2f7932b0
    • Mao Han's avatar
      csky: Add perf callchain support · cfa4d93b
      Mao Han authored
      This patch add support for perf callchain sampling on csky platform.
      As fp is used to unwind the stack, the program being sampled and the
      C library need to be compiled with -mbacktrace for user callchains,
      kernel callchains require CONFIG_STACKTRACE = y.
      
      Changelog:
       - Coding convention with Christoph's advice for riscv's.
      Signed-off-by: default avatarMao Han <han_mao@c-sky.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      cfa4d93b
    • Guo Ren's avatar
      csky/ftrace: Add dynamic function tracer (include graph tracer) · 28bb030f
      Guo Ren authored
      Support dynamic ftrace including dynamic graph tracer. Gcc-csky with -pg
      will produce call site in every function prologue and we can use these
      call site to hook trace function.
      
      gcc with -pg origin call site:
      	push	lr
      	jbsr	_mcount
      	nop32
      	nop32
      
      If the (callee - caller)'s offset is in range of bsr instruction, we'll
      modify code with:
      	push	lr
      	bsr	_mcount
      	nop32
      	nop32
      Else if the (callee - caller)'s offset is out of bsr instrunction, we'll
      modify code with:
      	push	lr
      	movih	r26, ...
      	ori	r26, ...
      	jsr	r26
      
      (r26 is reserved for jsr link reg in csky abiv2 spec.)
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      28bb030f
    • Guo Ren's avatar
      csky: Fixup vdsp&fpu issues in kernel · 3dfc242f
      Guo Ren authored
      This fixup is continue to commit 35ff802a (csky: fixup remove
      vdsp implement for kernel.) and in that patch I didn't finish the
      job. We must forbid gcc to generate any vdsp & fpu instructions
      and remove vdsp asm in memmove.S.
      
      eg: For GCC it's -mcpu=ck860 and For AS it's -Wa,-mcpu=ck860fv
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      3dfc242f
  2. 21 Apr, 2019 1 commit
  3. 20 Apr, 2019 11 commits
  4. 19 Apr, 2019 16 commits