1. 13 5月, 2020 1 次提交
    • G
      csky: Fixup calltrace panic · 18c07d23
      Guo Ren 提交于
      The implementation of show_stack will panic with wrong fp:
      
      addr    = *fp++;
      
      because the fp isn't checked properly.
      
      The current implementations of show_stack, wchan and stack_trace
      haven't been designed properly, so just deprecate them.
      
      This patch is a reference to riscv's way, all codes are modified from
      arm's. The patch is passed with:
      
       - cat /proc/<pid>/stack
       - cat /proc/<pid>/wchan
       - echo c > /proc/sysrq-trigger
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      18c07d23
  2. 03 4月, 2020 2 次提交
    • G
      csky: Add uprobes support · 8f6bb793
      Guo Ren 提交于
      This patch adds support for uprobes on csky architecture.
      
      Just like kprobe, it support single-step and simulate instructions.
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      8f6bb793
    • G
      csky: Add kprobes supported · 33e53ae1
      Guo Ren 提交于
      This patch enable kprobes, kretprobes, ftrace interface. It utilized
      software breakpoint and single step debug exceptions, instructions
      simulation on csky.
      
      We use USR_BKPT replace origin instruction, and the kprobe handler
      prepares an excutable memory slot for out-of-line execution with a
      copy of the original instruction being probed. Most of instructions
      could be executed by single-step, but some instructions need origin
      pc value to execute and we need software simulate these instructions.
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      33e53ae1
  3. 02 4月, 2020 1 次提交
  4. 01 4月, 2020 1 次提交
  5. 08 3月, 2020 3 次提交
  6. 21 2月, 2020 9 次提交
    • G
      csky: Implement copy_thread_tls · 0b9f386c
      Guo Ren 提交于
      This is required for clone3 which passes the TLS value through a
      struct rather than a register.
      
      Cc: Amanieu d'Antras <amanieu@gmail.com>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      0b9f386c
    • M
      csky: Add PCI support · 5b49c82d
      MaJun 提交于
      Add the pci related code for csky arch to support basic pci virtual
      function, such as qemu virt-pci-9pfs.
      Signed-off-by: NMaJun <majun258@linux.alibaba.com>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      5b49c82d
    • K
      csky: Cleanup old Kconfig options · 4ec575b7
      Krzysztof Kozlowski 提交于
      CONFIG_CLKSRC_OF is gone since commit bb0eb050
      ("clocksource/drivers: Rename CLKSRC_OF to TIMER_OF").  The platform
      already selects TIMER_OF.
      
      CONFIG_HAVE_DMA_API_DEBUG is gone since commit 6e88628d ("dma-debug:
      remove CONFIG_HAVE_DMA_API_DEBUG").
      
      CONFIG_DEFAULT_DEADLINE is gone since commit f382fb0b ("block:
      remove legacy IO schedulers").
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      4ec575b7
    • R
      arch/csky: fix some Kconfig typos · bebd26ab
      Randy Dunlap 提交于
      Fix wording in help text for the CPU_HAS_LDSTEX symbol.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NGuo Ren <guoren@kernel.org>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      bebd26ab
    • G
      csky: Support icache flush without specific instructions · 761b4f69
      Guo Ren 提交于
      Some CPUs don't support icache specific instructions to flush icache
      lines in broadcast way. We use cpu control registers to flush local
      icache and use IPI to notify other cores.
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      761b4f69
    • G
      csky/Kconfig: Add Kconfig.platforms to support some drivers · a736fa1e
      Guo Ren 提交于
      Such as snps,dw-apb-ictl
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      a736fa1e
    • G
      csky: Separate fixaddr_init from highmem · f136008f
      Guo Ren 提交于
      After fixaddr_init is separated from highmem, we could use tcm
      without highmem selected. (610 (abiv1) don't support highmem,
      but it could use tcm now.)
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      f136008f
    • G
      csky: Tightly-Coupled Memory or Sram support · f525bb2c
      Guo Ren 提交于
      The implementation are not only used by TCM but also used by sram on
      SOC bus. It follow existed linux tcm software interface, so that old
      tcm application codes could be re-used directly.
      
      Software interface list in asm/tcm.h:
       - Variables/Const: 	__tcmdata, __tcmconst
       - Functions:		__tcmfunc, __tcmlocalfunc
       - Malloc/Free:		tcm_alloc, tcm_free
      
      In linux menuconfig:
       - Choose a TCM contain instrctions + data or separated in ITCM/DTCM.
       - Determine TCM_BASE (DTCM_BASE) in phyiscal address.
       - Determine size of TCM or ITCM(DTCM) in page counts.
      
      Here is hello tcm example from Documentation/arm/tcm.rst which could
      be directly used:
      
      /* Uninitialized data */
      static u32 __tcmdata tcmvar;
      /* Initialized data */
      static u32 __tcmdata tcmassigned = 0x2BADBABEU;
      /* Constant */
      static const u32 __tcmconst tcmconst = 0xCAFEBABEU;
      
      static void __tcmlocalfunc tcm_to_tcm(void)
      {
      	int i;
      	for (i = 0; i < 100; i++)
      		tcmvar ++;
      }
      
      static void __tcmfunc hello_tcm(void)
      {
      	/* Some abstract code that runs in ITCM */
      	int i;
      	for (i = 0; i < 100; i++) {
      		tcmvar ++;
      	}
      	tcm_to_tcm();
      }
      
      static void __init test_tcm(void)
      {
      	u32 *tcmem;
      	int i;
      
      	hello_tcm();
      	printk("Hello TCM executed from ITCM RAM\n");
      
      	printk("TCM variable from testrun: %u @ %p\n", tcmvar, &tcmvar);
      	tcmvar = 0xDEADBEEFU;
      	printk("TCM variable: 0x%x @ %p\n", tcmvar, &tcmvar);
      
      	printk("TCM assigned variable: 0x%x @ %p\n", tcmassigned, &tcmassigned);
      
      	printk("TCM constant: 0x%x @ %p\n", tcmconst, &tcmconst);
      
      	/* Allocate some TCM memory from the pool */
      	tcmem = tcm_alloc(20);
      	if (tcmem) {
      		printk("TCM Allocated 20 bytes of TCM @ %p\n", tcmem);
      		tcmem[0] = 0xDEADBEEFU;
      		tcmem[1] = 0x2BADBABEU;
      		tcmem[2] = 0xCAFEBABEU;
      		tcmem[3] = 0xDEADBEEFU;
      		tcmem[4] = 0x2BADBABEU;
      		for (i = 0; i < 5; i++)
      			printk("TCM tcmem[%d] = %08x\n", i, tcmem[i]);
      		tcm_free(tcmem, 20);
      	}
      }
      
      TODO:
       - Separate fixup mapping from highmem
       - Support abiv1
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      f525bb2c
    • M
      csky: Initial stack protector support · 2f78c73f
      Mao Han 提交于
      This is a basic -fstack-protector support without per-task canary
      switching. The protector will report something like when stack
      corruption is detected:
      
      It's tested with strcpy local array overflow in sys_kill and get:
      stack-protector: Kernel stack is corrupted in: sys_kill+0x23c/0x23c
      
      TODO:
       - Support task switch for different cannary
      Signed-off-by: NMao Han <han_mao@c-sky.com>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      2f78c73f
  7. 12 11月, 2019 1 次提交
  8. 19 7月, 2019 1 次提交
  9. 21 5月, 2019 1 次提交
  10. 06 5月, 2019 1 次提交
  11. 22 4月, 2019 3 次提交
    • M
      csky: Add support for perf registers sampling · daac95e7
      Mao Han 提交于
      This patch implements the perf registers sampling and validation API
      for csky arch. The valid registers and their register ID are defined in
      perf_regs.h. Perf tool can backtrace in userspace with unwind library
      and the registers/user stack dump support.
      Signed-off-by: NMao Han <han_mao@c-sky.com>
      Signed-off-by: NGuo Ren <ren_guo@c-sky.com>
      daac95e7
    • G
      csky: Update syscall_trace_enter/exit implementation · 2f7932b0
      Guo Ren 提交于
      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: NGuo Ren <ren_guo@c-sky.com>
      Cc: Dmitry V. Levin <ldv@altlinux.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      2f7932b0
    • G
      csky/ftrace: Add dynamic function tracer (include graph tracer) · 28bb030f
      Guo Ren 提交于
      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: NGuo Ren <ren_guo@c-sky.com>
      28bb030f
  12. 03 4月, 2019 1 次提交
    • W
      locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs · 390a0c62
      Waiman Long 提交于
      Currently, we have two different implementation of rwsem:
      
       1) CONFIG_RWSEM_GENERIC_SPINLOCK (rwsem-spinlock.c)
       2) CONFIG_RWSEM_XCHGADD_ALGORITHM (rwsem-xadd.c)
      
      As we are going to use a single generic implementation for rwsem-xadd.c
      and no architecture-specific code will be needed, there is no point
      in keeping two different implementations of rwsem. In most cases, the
      performance of rwsem-spinlock.c will be worse. It also doesn't get all
      the performance tuning and optimizations that had been implemented in
      rwsem-xadd.c over the years.
      
      For simplication, we are going to remove rwsem-spinlock.c and make all
      architectures use a single implementation of rwsem - rwsem-xadd.c.
      
      All references to RWSEM_GENERIC_SPINLOCK and RWSEM_XCHGADD_ALGORITHM
      in the code are removed.
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NWaiman Long <longman@redhat.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: linux-riscv@lists.infradead.org
      Cc: linux-um@lists.infradead.org
      Cc: linux-xtensa@linux-xtensa.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: nios2-dev@lists.rocketboards.org
      Cc: openrisc@lists.librecores.org
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      Link: https://lkml.kernel.org/r/20190322143008.21313-3-longman@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      390a0c62
  13. 20 2月, 2019 1 次提交
  14. 19 2月, 2019 1 次提交
    • Y
      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option · 942fa985
      Yury Norov 提交于
      All new 32-bit architectures should have 64-bit userspace off_t type, but
      existing architectures has 32-bit ones.
      
      To enforce the rule, new config option is added to arch/Kconfig that defaults
      ARCH_32BIT_OFF_T to be disabled for new 32-bit architectures. All existing
      32-bit architectures enable it explicitly.
      
      New option affects force_o_largefile() behaviour. Namely, if userspace
      off_t is 64-bits long, we have no reason to reject user to open big files.
      
      Note that even if architectures has only 64-bit off_t in the kernel
      (arc, c6x, h8300, hexagon, nios2, openrisc, and unicore32),
      a libc may use 32-bit off_t, and therefore want to limit the file size
      to 4GB unless specified differently in the open flags.
      Signed-off-by: NYury Norov <ynorov@caviumnetworks.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NYury Norov <ynorov@marvell.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      942fa985
  15. 14 2月, 2019 1 次提交
  16. 02 1月, 2019 1 次提交
  17. 31 12月, 2018 4 次提交
  18. 14 12月, 2018 1 次提交
  19. 02 12月, 2018 3 次提交
  20. 31 10月, 2018 2 次提交
  21. 25 10月, 2018 1 次提交