1. 05 5月, 2014 1 次提交
    • C
      lib: Export interval_tree · a88cc108
      Chris Wilson 提交于
      lib/interval_tree.c provides a simple interface for an interval-tree
      (an augmented red-black tree) but is only built when testing the generic
      macros for building interval-trees. For drivers with modest needs,
      export the simple interval-tree library as is.
      
      v2: Lots of help from Michel Lespinasse to only compile the code
          as required:
          - make INTERVAL_TREE a config option
          - make INTERVAL_TREE_TEST select the library functions
            and sanitize the filenames & Makefile
          - prepare interval_tree for being built as a module if required
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NMichel Lespinasse <walken@google.com>
      [Acked for inclusion via drm/i915 by Andrew Morton.]
      [danvet: switch to _GPL as per the mailing list discussion.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a88cc108
  2. 19 4月, 2014 1 次提交
  3. 02 4月, 2014 1 次提交
  4. 24 2月, 2014 2 次提交
  5. 05 2月, 2014 1 次提交
    • L
      kbuild: don't enable DEBUG_INFO when building for COMPILE_TEST · 12b13835
      Linus Torvalds 提交于
      It really isn't very interesting to have DEBUG_INFO when doing compile
      coverage stuff (you wouldn't want to run the result anyway, that's kind
      of the whole point of COMPILE_TEST), and it currently makes the build
      take longer and use much more disk space for "all{yes,mod}config".
      
      There's somewhat active discussion about this still, and we might end up
      with some new config option for things like this (Andi points out that
      the silly X86_DECODER_SELFTEST option also slows down the normal
      coverage tests hugely), but I'm starting the ball rolling with this
      simple one-liner.
      
      DEBUG_INFO isn't that noticeable if you have tons of memory and a good
      IO subsystem, but it hurts you a lot if you don't - for very little
      upside for the common use.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      12b13835
  6. 24 1月, 2014 2 次提交
    • K
      test: check copy_to/from_user boundary validation · 3e2a4c18
      Kees Cook 提交于
      To help avoid an architecture failing to correctly check kernel/user
      boundaries when handling copy_to_user, copy_from_user, put_user, or
      get_user, perform some simple tests and fail to load if any of them
      behave unexpectedly.
      
      Specifically, this is to make sure there is a way to notice if things
      like what was fixed in commit 8404663f ("ARM: 7527/1: uaccess:
      explicitly check __user pointer when !CPU_USE_DOMAINS") ever regresses
      again, for any architecture.
      
      Additionally, adds new "user" selftest target, which loads this module.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3e2a4c18
    • K
      test: add minimal module for verification testing · 93e9ef83
      Kees Cook 提交于
      This is a pair of test modules I'd like to see in the tree.  Instead of
      putting these in lkdtm, where I've been adding various tests that trigger
      crashes, these don't make sense there since they need to be either
      distinctly separate, or their pass/fail state don't need to crash the
      machine.
      
      These live in lib/ for now, along with a few other in-kernel test modules,
      and use the slightly more common "test_" naming convention, instead of
      "test-".  We should likely standardize on the former:
      
      $ find . -name 'test_*.c' | grep -v /tools/ | wc -l
      4
      $ find . -name 'test-*.c' | grep -v /tools/ | wc -l
      2
      
      The first is entirely a no-op module, designed to allow simple testing of
      the module loading and verification interface.  It's useful to have a
      module that has no other uses or dependencies so it can be reliably used
      for just testing module loading and verification.
      
      The second is a module that exercises the user memory access functions, in
      an effort to make sure that we can quickly catch any regressions in
      boundary checking (e.g.  like what was recently fixed on ARM).
      
      This patch (of 2):
      
      When doing module loading verification tests (for example, with module
      signing, or LSM hooks), it is very handy to have a module that can be
      built on all systems under test, isn't auto-loaded at boot, and has no
      device or similar dependencies.  This creates the "test_module.ko" module
      for that purpose, which only reports its load and unload to printk.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      93e9ef83
  7. 22 1月, 2014 1 次提交
    • D
      dma-debug: introduce debug_dma_assert_idle() · 0abdd7a8
      Dan Williams 提交于
      Record actively mapped pages and provide an api for asserting a given
      page is dma inactive before execution proceeds.  Placing
      debug_dma_assert_idle() in cow_user_page() flagged the violation of the
      dma-api in the NET_DMA implementation (see commit 77873803 "net_dma:
      mark broken").
      
      The implementation includes the capability to count, in a limited way,
      repeat mappings of the same page that occur without an intervening
      unmap.  This 'overlap' counter is limited to the few bits of tag space
      in a radix tree.  This mechanism is added to mitigate false negative
      cases where, for example, a page is dma mapped twice and
      debug_dma_assert_idle() is called after the page is un-mapped once.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0abdd7a8
  8. 13 1月, 2014 1 次提交
  9. 26 11月, 2013 1 次提交
    • J
      panic: Make panic_timeout configurable · 5800dc3c
      Jason Baron 提交于
      The panic_timeout value can be set via the command line option
      'panic=x', or via /proc/sys/kernel/panic, however that is not
      sufficient when the panic occurs before we are able to set up
      these values. Thus, add a CONFIG_PANIC_TIMEOUT so that we can
      set the desired value from the .config.
      
      The default panic_timeout value continues to be 0 - wait
      forever. Also adds set_arch_panic_timeout(new_timeout,
      arch_default_timeout), which is intended to be used by arches in
      arch_setup(). The idea being that the new_timeout is only set if
      the user hasn't changed from the arch_default_timeout.
      Signed-off-by: NJason Baron <jbaron@akamai.com>
      Cc: benh@kernel.crashing.org
      Cc: paulus@samba.org
      Cc: ralf@linux-mips.org
      Cc: mpe@ellerman.id.au
      Cc: felipe.contreras@gmail.com
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1a1674daec27c534df409697025ac568ebcee91e.1385418410.git.jbaron@akamai.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      5800dc3c
  10. 13 11月, 2013 1 次提交
  11. 29 10月, 2013 1 次提交
  12. 17 10月, 2013 1 次提交
  13. 13 9月, 2013 1 次提交
  14. 12 9月, 2013 1 次提交
  15. 05 9月, 2013 1 次提交
    • V
      Kconfig.debug: Add FRAME_POINTER anti-dependency for ARC · cc80ae38
      Vineet Gupta 提交于
      Frame pointer on ARC doesn't serve the conventional purpose of stack
      unwinding due to the typical way ABI designates it's usage.
      Thus it's explicit usage on ARC is discouraged (gcc is free to use it,
      for some tricky stack frames even if -fomit-frame-pointer).
      
      Hence no point enabling it for ARC.
      
      References: http://www.spinics.net/lists/kernel/msg1593937.htmlSigned-off-by: NVineet Gupta <vgupta@synopsys.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Paul E. McKenney" <paul.mckenney@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: linux-kernel@vger.kernel.org
      cc80ae38
  16. 26 7月, 2013 1 次提交
    • R
      kobject: delayed kobject release: help find buggy drivers · c817a67e
      Russell King 提交于
      Implement debugging for kobject release functions.  kobjects are
      reference counted, so the drop of the last reference to them is not
      predictable. However, the common case is for the last reference to be
      the kobject's removal from a subsystem, which results in the release
      function being immediately called.
      
      This can hide subtle bugs, which can occur when another thread holds a
      reference to the kobject at the same time that a kobject is removed.
      This results in the release method being delayed.
      
      In order to make these kinds of problems more visible, the following
      patch implements a delayed release; this has the effect that the
      release function will be out of order with respect to the removal of
      the kobject in the same manner that it would be if a reference was
      being held.
      
      This provides us with an easy way to allow driver writers to debug
      their drivers and fix otherwise hidden problems.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c817a67e
  17. 15 7月, 2013 1 次提交
    • P
      kernel: delete __cpuinit usage from all core kernel files · 0db0628d
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      This removes all the uses of the __cpuinit macros from C files in
      the core kernel directories (kernel, init, lib, mm, and include)
      that don't really have a specific maintainer.
      
      [1] https://lkml.org/lkml/2013/5/20/589Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      0db0628d
  18. 05 7月, 2013 7 次提交
  19. 26 6月, 2013 1 次提交
    • D
      mutex: Add w/w mutex slowpath debugging · 23010027
      Daniel Vetter 提交于
      Injects EDEADLK conditions at pseudo-random interval, with
      exponential backoff up to UINT_MAX (to ensure that every lock
      operation still completes in a reasonable time).
      
      This way we can test the wound slowpath even for ww mutex users
      where contention is never expected, and the ww deadlock
      avoidance algorithm is only needed for correctness against
      malicious userspace. An example would be protecting kernel
      modesetting properties, which thanks to single-threaded X isn't
      really expected to contend, ever.
      
      I've looked into using the CONFIG_FAULT_INJECTION
      infrastructure, but decided against it for two reasons:
      
      - EDEADLK handling is mandatory for ww mutex users and should
        never affect the outcome of a syscall. This is in contrast to -ENOMEM
        injection. So fine configurability isn't required.
      
      - The fault injection framework only allows to set a simple
        probability for failure. Now the probability that a ww mutex acquire
        stage with N locks will never complete (due to too many injected
        EDEADLK backoffs) is zero. But the expected number of ww_mutex_lock
        operations for the completely uncontended case would be O(exp(N)).
        The per-acuiqire ctx exponential backoff solution choosen here only
        results in O(log N) overhead due to injection and so O(log N * N)
        lock operations. This way we can fail with high probability (and so
        have good test coverage even for fancy backoff and lock acquisition
        paths) without running into patalogical cases.
      
      Note that EDEADLK will only ever be injected when we managed to
      acquire the lock. This prevents any behaviour changes for users
      which rely on the EALREADY semantics.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linaro-mm-sig@lists.linaro.org
      Cc: rostedt@goodmis.org
      Cc: daniel@ffwll.ch
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20130620113117.4001.21681.stgit@patserSigned-off-by: NIngo Molnar <mingo@kernel.org>
      23010027
  20. 22 6月, 2013 1 次提交
  21. 01 5月, 2013 3 次提交
  22. 03 3月, 2013 1 次提交
    • J
      Kconfig.debug: add METAG to dependency lists · 79f83c02
      James Hogan 提交于
      Add [!]METAG to a couple of Kconfig dependencies in lib/Kconfig.debug.
      Don't allow stack utilization instrumentation on metag, and allow
      building with frame pointers.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Paul E. McKenney" <paul.mckenney@linaro.org>
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      79f83c02
  23. 22 2月, 2013 1 次提交
  24. 29 1月, 2013 1 次提交
  25. 27 1月, 2013 1 次提交
  26. 18 1月, 2013 1 次提交
  27. 09 1月, 2013 1 次提交
    • P
      rcu: Reduce rcutorture tracing · 52494535
      Paul E. McKenney 提交于
      Currently, rcutorture traces every read-side access.  This can be
      problematic because even a two-minute rcutorture run on a two-CPU system
      can generate 28,853,363 reads.  Normally, only a failing read is of
      interest, so this commit traces adjusts rcutorture's tracing to only
      trace failing reads.  The resulting event tracing records the time
      and the ->completed value captured at the beginning of the RCU read-side
      critical section, allowing correlation with other event-tracing messages.
      Signed-off-by: NPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      [ paulmck: Add fix to build problem located by Randy Dunlap based on
        diagnosis by Steven Rostedt. ]
      52494535
  28. 04 1月, 2013 1 次提交
    • G
      misc: remove __dev* attributes. · 6ae14171
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the last of the __dev* markings from the kernel from
      a variety of different, tiny, places.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6ae14171
  29. 14 12月, 2012 1 次提交
  30. 03 12月, 2012 1 次提交