Skip to contentSkip to conversation

kmemcheck.git

GIT PULL Vegard Nossum 2 participants 2 messages Oct 22, 2008 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

[Resend with Cc: linux-kernel]

Hei,

A few updates below. No code changes except for the mismerge in sysctl table. Please pull, thanks a lot :-)

Vegard

The following changes since commit 760932c8607b736504a134ed6feec25e90e089ac:
Vegard Nossum (1):
kmemcheck: (finally) use 4k pages for identity mapping

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/vegard/kmemcheck.git
for-tip-kmemcheck-v2

Vegard Nossum (5):
x86: fix mis-merge
kmemcheck: fix mis-merge in sysctl table
kmemcheck: update documentation
kmemcheck: update Kconfig help text
kmemcheck: document the shadow member of struct page

 Documentation/kmemcheck.txt  |   12 +++---------
 arch/x86/Kconfig.debug       |   11 ++++++-----
 arch/x86/kernel/cpu/common.c |    4 ----
 include/linux/mm_types.h     |    4 ++++
 kernel/sysctl.c              |   20 ++++++++++----------
 5 files changed, 23 insertions(+), 28 deletions(-)
Documentation/kmemcheck.txt +0 -0
index 843a63c..a848d49 100644
@@ -82,15 +82,9 @@ The most prominent problem seems to be that of

bit-fields. kmemcheck can only
track memory with byte granularity. Therefore, when gcc generates code to access only one bit in a bit-field, there is really no way for kmemcheck to know which of the other bits will be used or thrown away. Consequently, there
-may be bogus warnings for bit-field accesses. There is some experimental -support to detect this automatically, though it is probably better to work -around this by explicitly initializing whole bit-fields at once. -
-Some allocations are used for DMA. As DMA doesn't go through the paging -mechanism, we have absolutely no way to detect DMA writes. This means that -spurious warnings may be seen on access to DMA memory. DMA allocations should -be annotated with the __GFP_NOTRACK flag or allocated from caches marked -SLAB_NOTRACK to work around this problem.
+may be bogus warnings for bit-field accesses. We have added a "bitfields" API +to get around this problem. See include/linux/kmemcheck.h for detailed +instructions!

Parameters

arch/x86/Kconfig.debug +6 -5
index d393ad1..73cc0d3 100644
@@ -338,11 +338,12 @@ config KMEMCHECK_QUEUE_SIZE
       depends on KMEMCHECK
       default 64
       help
-         Select the maximum number of errors to store in the queue. This
-         queue will be emptied once every second, so this is effectively a
-         limit on how many reports to print in one go. Note however, that
-         if the number of errors occuring between two bursts is larger than
-         this number, the extra error reports will get lost.
+         Select the maximum number of errors to store in the queue. Since
+         errors can occur virtually anywhere and in any context, we need a
+         temporary storage area which is guarantueed not to generate any
+         other faults. The queue will be emptied as soon as a tasklet may
+         be scheduled. If the queue is full, new error reports will be
+         lost.
 
 config KMEMCHECK_SHADOW_COPY_SHIFT
       int "kmemcheck: shadow copy size (5 => 32 bytes, 6 => 64 bytes)"
arch/x86/kernel/cpu/common.c +0 -4
index ff26d87..25581dc 100644
@@ -581,10 +581,6 @@ void __init early_cpu_init(void)
 * The NOPL instruction is supposed to exist on all CPUs with
 * family >= 6; unfortunately, that's not true in practice because
 * of early VIA chips and (more importantly) broken virtualizers that
- *
- * Note: no 64-bit chip is known to lack these, but put the code here
- * for consistency with 32 bits, and to make it utterly trivial to
- * diagnose the problem should it ever surface.
 * are not easy to detect.  In the latter case it doesn't even *fail*
 * reliably, so probing for it doesn't even work.  Disable it completely
 * unless we can find a reliable way to detect all the broken cases.
include/linux/mm_types.h +4 -0
index bca924a..02d66ab 100644
@@ -99,6 +99,10 @@ struct page {
 #endif
 
 #ifdef CONFIG_KMEMCHECK
+       /*
+        * kmemcheck wants to track the status of each byte in a page; this
+        * is a pointer to such a status block. NULL if not tracked.
+        */
       void *shadow;
 #endif
 };
kernel/sysctl.c +10 -10
index 73fcc23..c7f9d77 100644
@@ -836,6 +836,16 @@ static struct ctl_table kern_table[] = {
               .child          = key_sysctls,
       },
 #endif
+#ifdef CONFIG_RCU_TORTURE_TEST
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "rcutorture_runnable",
+               .data           = &rcutorture_runnable,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+#endif
 #ifdef CONFIG_KMEMCHECK
       {
               .ctl_name       = CTL_UNNUMBERED,
@@ -1176,16 +1186,6 @@ static struct ctl_table vm_table[] = {
               .extra2         = &one,
       },
 #endif
-#ifdef CONFIG_RCU_TORTURE_TEST
-       {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "rcutorture_runnable",
-               .data           = &rcutorture_runnable,
-               .maxlen         = sizeof(int),
-               .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-       },
-#endif
 /*
 * NOTE: do not add new entries to this table unless you have read
 * Documentation/sysctl/ctl_unnumbered.txt
#2 lore raw
Quoted 6 lines · Vegard Nossum

[Resend with Cc: linux-kernel]

Hei,

A few updates below. No code changes except for the mismerge in sysctl table. Please pull, thanks a lot :-)

pulled into tip/kmemcheck, thanks Vegard!

Ingo