1. 22 9月, 2009 1 次提交
  2. 15 6月, 2009 4 次提交
    • V
      kmemcheck: introduce bitfield API · fc7d0c9f
      Vegard Nossum 提交于
      Add the bitfield API which can be used to annotate bitfields in structs
      and get rid of false positive reports.
      
      According to Al Viro, the syntax we were using (putting #ifdef inside
      macro arguments) was not valid C. He also suggested using begin/end
      markers instead, which is what we do now.
      
      [rebased for mainline inclusion]
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      fc7d0c9f
    • V
      kmemcheck: add hooks for the page allocator · b1eeab67
      Vegard Nossum 提交于
      This adds support for tracking the initializedness of memory that
      was allocated with the page allocator. Highmem requests are not
      tracked.
      
      Cc: Dave Hansen <dave@linux.vnet.ibm.com>
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      
      [build fix for !CONFIG_KMEMCHECK]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      
      [rebased for mainline inclusion]
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      b1eeab67
    • V
      kmemcheck: add DMA hooks · d7002857
      Vegard Nossum 提交于
      This patch hooks into the DMA API to prevent the reporting of the
      false positives that would otherwise be reported when memory is
      accessed that is also used directly by devices.
      
      [rebased for mainline inclusion]
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      d7002857
    • V
      kmemcheck: add mm functions · 2dff4405
      Vegard Nossum 提交于
      With kmemcheck enabled, the slab allocator needs to do this:
      
      1. Tell kmemcheck to allocate the shadow memory which stores the status of
         each byte in the allocation proper, e.g. whether it is initialized or
         uninitialized.
      2. Tell kmemcheck which parts of memory that should be marked uninitialized.
         There are actually a few more states, such as "not yet allocated" and
         "recently freed".
      
      If a slab cache is set up using the SLAB_NOTRACK flag, it will never return
      memory that can take page faults because of kmemcheck.
      
      If a slab cache is NOT set up using the SLAB_NOTRACK flag, callers can still
      request memory with the __GFP_NOTRACK flag. This does not prevent the page
      faults from occuring, however, but marks the object in question as being
      initialized so that no warnings will ever be produced for this object.
      
      In addition to (and in contrast to) __GFP_NOTRACK, the
      __GFP_NOTRACK_FALSE_POSITIVE flag indicates that the allocation should
      not be tracked _because_ it would produce a false positive. Their values
      are identical, but need not be so in the future (for example, we could now
      enable/disable false positives with a config option).
      
      Parts of this patch were contributed by Pekka Enberg but merged for
      atomicity.
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      
      [rebased for mainline inclusion]
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      2dff4405
  3. 13 6月, 2009 1 次提交