1. 02 3月, 2017 2 次提交
  2. 19 1月, 2016 1 次提交
  3. 24 6月, 2015 1 次提交
  4. 11 5月, 2015 1 次提交
    • C
      tile: improve stack backtrace · 47ad7b9b
      Chris Metcalf 提交于
      This commit fixes a number of issues with the tile backtrace code.
      
      - Don't try to identify userspace shared object or executable paths
        if we are doing a backtrace from an interrupt; it's not legal,
        and also unlikely to be interesting.  Likewise, don't try to do
        it for other address spaces, since d_path() assumes it is being
        called in "current" context.
      
      - Move "in_backtrace" from thread_struct to thread_info.
        This way we can access it even if our stack thread_info has been
        clobbered, which makes backtracing more robust.
      
      - Avoid using "current" directly when testing for is_sigreturn().
        Since "current" may be corrupt, we're better off using kbt->task
        explicitly to look up the vdso_base for the current task.
        Conveniently, this simplifies the internal APIs (we only need
        one is_sigreturn() function now).
      
      - Avoid bogus "Odd fault" warning when pc/sp/ex1 are all zero,
        as is true for kernel threads above the last frame.
      
      - Hook into Tejun Heo's dump_stack() framework in lib/dump_stack.c.
      
      - Write last entry in save_stack_trace() as ULONG_MAX, not zero,
        since ftrace (at least) relies on finding that marker.
      
      - Implement save_stack_trace_regs() and save_strack_trace_user(),
        and set CONFIG_USER_STACKTRACE_SUPPORT.
      Signed-off-by: NChris Metcalf <cmetcalf@ezchip.com>
      47ad7b9b
  5. 18 4月, 2015 1 次提交
    • C
      arch: tile: fix null pointer dereference on pt_regs pointer · 9088616f
      Colin Ian King 提交于
      Cppcheck reports the following issue:
      [arch/tile/kernel/stack.c:116]: (error) Possible null
        pointer dereference: p
      
      In this case, on reporting on an odd fault, p is set to NULL
      and immediately afterwords p is dereferenced iff
      !kbt->profile is false.  Rather than doing this check just
      return NULL rather than falling through to the potential
      null pointer dereference (since the original intentional
      outcome would be to return NULL anyhow) for this odd fault
      case.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com> [tweaked lightly]
      9088616f
  6. 12 11月, 2014 1 次提交
  7. 30 9月, 2013 1 次提交
  8. 04 9月, 2013 1 次提交
  9. 30 8月, 2013 1 次提交
    • C
      tilegx: change how we find the kernel stack · 35f05976
      Chris Metcalf 提交于
      Previously, we used a special-purpose register (SPR_SYSTEM_SAVE_K_0)
      to hold the CPU number and the top of the current kernel stack
      by using the low bits to hold the CPU number, and using the high
      bits to hold the address of the page just above where we'd want
      the kernel stack to be.  That way we could initialize a new SP
      when first entering the kernel by just masking the SPR value and
      subtracting a couple of words.
      
      However, it's actually more useful to be able to place an arbitrary
      kernel-top value in the SPR.  This allows us to create a new stack
      context (e.g. for virtualization) with an arbitrary top-of-stack VA.
      To make this work, we now store the CPU number in the high bits,
      above the highest legal VA bit (42 bits in the current tilegx
      microarchitecture).  The full 42 bits are thus available to store the
      top of stack value.  Getting the current cpu (a relatively common
      operation) is still fast; it's now a shift rather than a mask.
      
      We make this change only for tilegx, since tilepro has too few SPR
      bits to do this, and we don't need this support on tilepro anyway.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      35f05976
  10. 14 8月, 2013 3 次提交
    • C
      tile: implement gettimeofday() via vDSO · 4a556f4f
      Chris Metcalf 提交于
      This change creates the framework for vDSO calls, makes the existing
      rt_sigreturn() mechanism use it, and adds a fast gettimeofday().
      Now that we need to expose the vDSO address to userspace, we add
      AT_SYSINFO_EHDR to the set of aux entries provided to userspace.
      (You can disable any extra vDSO support by booting with vdso=0,
      but the rt_sigreturn vDSO page will still be provided.)
      
      Note that glibc has supported the tile vDSO since release 2.17.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      4a556f4f
    • C
      tile: support CONFIG_PREEMPT · bc1a298f
      Chris Metcalf 提交于
      This change adds support for CONFIG_PREEMPT (full kernel preemption).
      In addition to the core support, this change includes a number
      of places where we fix up uses of smp_processor_id() and per-cpu
      variables.  I also eliminate the PAGE_HOME_HERE and PAGE_HOME_UNKNOWN
      values for page homing, as it turns out they weren't being used.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      bc1a298f
    • C
      tile: avoid recursive backtrace faults · 3ef23111
      Chris Metcalf 提交于
      This change adds support for avoiding recursive backtracer crashes;
      we haven't seen this in practice other than when things are seriously
      corrupt, but it may help avoid losing the root cause of a crash.
      
      Also, don't abort kernel backtracers for invalid userspace PC's.
      If we do, we lose the ability to backtrace through a userspace
      call to a bad address above PAGE_OFFSET, even though that it can
      be perfectly reasonable to continue the backtrace in such a case.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      3ef23111
  11. 19 6月, 2013 1 次提交
  12. 09 2月, 2013 1 次提交
  13. 05 2月, 2013 1 次提交
  14. 03 4月, 2012 1 次提交
    • C
      arch/tile: various bugs in stack backtracer · 5f639fdc
      Chris Metcalf 提交于
      Fix a long-standing bug in the stack backtracer where we would print
      garbage to the console instead of kernel function names, if the kernel
      wasn't built with symbol support (e.g. mboot).
      
      Make sure to tag every line of userspace backtrace output if we actually
      have the mmap_sem, since that way if there's no tag, we know that it's
      because we couldn't trylock the semaphore.
      
      Stop doing a TLB flush and examining page tables during backtrace.
      Instead, just trust that __copy_from_user_inatomic() will properly fault
      and return a failure, which it should do in all cases.
      
      Fix a latent bug where the backtracer would directly examine a signal
      context in user space, rather than copying it safely to kernel memory
      first.  This meant that a race with another thread could potentially
      have caused a kernel panic.
      
      Guard against unaligned sp when trying to restart backtrace at an
      interrupt or signal handler point in the kernel backtracer.
      
      Report kernel symbolic information for the call instruction rather
      than for the following instruction.  We still report the actual numeric
      address corresponding to the instruction after the call, for the sake
      of consistency with the normal expectations for stack backtracers.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      5f639fdc
  15. 02 4月, 2012 1 次提交
  16. 03 5月, 2011 1 次提交
    • C
      arch/tile: refactor backtracing code · 93013a0f
      Chris Metcalf 提交于
      This change is the result of some work to make the backtrace code more
      shareable between kernel, libc, and gdb.
      
      For the kernel, some good effects are to eliminate the hacky
      "VirtualAddress" typedef in favor of "unsigned long", to eliminate a
      bunch of spurious kernel doc comments, to remove the dead "bt_read_memory"
      function, and to use "__tilegx__" in #ifdefs instead of "TILE_CHIP".
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      93013a0f
  17. 02 3月, 2011 1 次提交
    • C
      arch/tile: fix two bugs in the backtracer code · 3cebbafd
      Chris Metcalf 提交于
      The first is that we were using an incorrect hand-rolled variant
      of __kernel_text_address() which didn't handle module PCs.  We now
      just use the standard API.
      
      The second was that we weren't accounting for the three-level
      page table when we were trying to pre-verify the addresses on
      the 64-bit TILE-Gx processor; we now do that correctly.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      3cebbafd
  18. 15 10月, 2010 1 次提交
  19. 15 9月, 2010 1 次提交
    • C
      arch/tile: Change struct sigcontext to be more useful · 74fca9da
      Chris Metcalf 提交于
      Rather than just using pt_regs, it now contains the actual saved
      state explicitly, similar to pt_regs.  By doing it this way, we
      provide a cleaner API for userspace (or equivalently, we avoid the
      need for libc to provide its own definition of sigcontext).
      
      While we're at it, move PT_FLAGS_xxx to where they are not visible
      from userspace.  And always pass siginfo and mcontext to signal
      handlers, even if they claim they don't need it, since sometimes
      they actually try to use it anyway in practice.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      74fca9da
  20. 13 8月, 2010 1 次提交
  21. 07 7月, 2010 1 次提交
    • C
      arch/tile: Miscellaneous cleanup changes. · 0707ad30
      Chris Metcalf 提交于
      This commit is primarily changes caused by reviewing "sparse"
      and "checkpatch" output on our sources, so is somewhat noisy, since
      things like "printk() -> pr_err()" (or whatever) throughout the
      codebase tend to get tedious to read.  Rather than trying to tease
      apart precisely which things changed due to which type of code
      review, this commit includes various cleanups in the code:
      
      - sparse: Add declarations in headers for globals.
      - sparse: Fix __user annotations.
      - sparse: Using gfp_t consistently instead of int.
      - sparse: removing functions not actually used.
      - checkpatch: Clean up printk() warnings by using pr_info(), etc.;
        also avoid partial-line printks except in bootup code.
        - checkpatch: Use exposed structs rather than typedefs.
        - checkpatch: Change some C99 comments to C89 comments.
      
      In addition, a couple of minor other changes are rolled in
      to this commit:
      
      - Add support for a "raise" instruction to cause SIGFPE, etc., to be raised.
      - Remove some compat code that is unnecessary when we fully eliminate
        some of the deprecated syscalls from the generic syscall ABI.
      - Update the tile_defconfig to reflect current config contents.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      0707ad30
  22. 05 6月, 2010 1 次提交