Back to home page

LXR

 
 

    


0001 config HAVE_ARCH_KMEMCHECK
0002         bool
0003 
0004 if HAVE_ARCH_KMEMCHECK
0005 
0006 menuconfig KMEMCHECK
0007         bool "kmemcheck: trap use of uninitialized memory"
0008         depends on DEBUG_KERNEL
0009         depends on !X86_USE_3DNOW
0010         depends on SLUB || SLAB
0011         depends on !CC_OPTIMIZE_FOR_SIZE
0012         depends on !FUNCTION_TRACER
0013         select FRAME_POINTER
0014         select STACKTRACE
0015         default n
0016         help
0017           This option enables tracing of dynamically allocated kernel memory
0018           to see if memory is used before it has been given an initial value.
0019           Be aware that this requires half of your memory for bookkeeping and
0020           will insert extra code at *every* read and write to tracked memory
0021           thus slow down the kernel code (but user code is unaffected).
0022 
0023           The kernel may be started with kmemcheck=0 or kmemcheck=1 to disable
0024           or enable kmemcheck at boot-time. If the kernel is started with
0025           kmemcheck=0, the large memory and CPU overhead is not incurred.
0026 
0027 choice
0028         prompt "kmemcheck: default mode at boot"
0029         depends on KMEMCHECK
0030         default KMEMCHECK_ONESHOT_BY_DEFAULT
0031         help
0032           This option controls the default behaviour of kmemcheck when the
0033           kernel boots and no kmemcheck= parameter is given.
0034 
0035 config KMEMCHECK_DISABLED_BY_DEFAULT
0036         bool "disabled"
0037         depends on KMEMCHECK
0038 
0039 config KMEMCHECK_ENABLED_BY_DEFAULT
0040         bool "enabled"
0041         depends on KMEMCHECK
0042 
0043 config KMEMCHECK_ONESHOT_BY_DEFAULT
0044         bool "one-shot"
0045         depends on KMEMCHECK
0046         help
0047           In one-shot mode, only the first error detected is reported before
0048           kmemcheck is disabled.
0049 
0050 endchoice
0051 
0052 config KMEMCHECK_QUEUE_SIZE
0053         int "kmemcheck: error queue size"
0054         depends on KMEMCHECK
0055         default 64
0056         help
0057           Select the maximum number of errors to store in the queue. Since
0058           errors can occur virtually anywhere and in any context, we need a
0059           temporary storage area which is guarantueed not to generate any
0060           other faults. The queue will be emptied as soon as a tasklet may
0061           be scheduled. If the queue is full, new error reports will be
0062           lost.
0063 
0064 config KMEMCHECK_SHADOW_COPY_SHIFT
0065         int "kmemcheck: shadow copy size (5 => 32 bytes, 6 => 64 bytes)"
0066         depends on KMEMCHECK
0067         range 2 8
0068         default 5
0069         help
0070           Select the number of shadow bytes to save along with each entry of
0071           the queue. These bytes indicate what parts of an allocation are
0072           initialized, uninitialized, etc. and will be displayed when an
0073           error is detected to help the debugging of a particular problem.
0074 
0075 config KMEMCHECK_PARTIAL_OK
0076         bool "kmemcheck: allow partially uninitialized memory"
0077         depends on KMEMCHECK
0078         default y
0079         help
0080           This option works around certain GCC optimizations that produce
0081           32-bit reads from 16-bit variables where the upper 16 bits are
0082           thrown away afterwards. This may of course also hide some real
0083           bugs.
0084 
0085 config KMEMCHECK_BITOPS_OK
0086         bool "kmemcheck: allow bit-field manipulation"
0087         depends on KMEMCHECK
0088         default n
0089         help
0090           This option silences warnings that would be generated for bit-field
0091           accesses where not all the bits are initialized at the same time.
0092           This may also hide some real bugs.
0093 
0094 endif