public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] kmemcheck updates for -tip
@ 2009-02-22 13:57 Vegard Nossum
  2009-02-22 16:44 ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: Vegard Nossum @ 2009-02-22 13:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Pekka Enberg, linux-kernel

Hi,

Here are the latest kmemcheck developments. Changes are basically:

1. Bitfield annotations.
2. Fix REP handling on P4s.
3. Page allocator hooks.

At boot, I get two false positives, in copy_mount_options() and
__dequeue_signal(). I've also seen two spontaneous floods of warnings from
somewhere in aio code, but I couldn't pinpoint exactly why things went
wrong. I guess it will need a bit more research.


Vegard


The following changes since commit 2215d76c949375d38b33f32580908accfffbb461:
  Ingo Molnar (1):
        Merge branch 'x86/core' into kmemcheck

are available in the git repository at:

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

Vegard Nossum (12):
      kmemcheck: bitfield API
      net: use kmemcheck bitfields API for skbuff
      net: annotate bitfields in struct inet_sock
      ieee1394: annotate bitfield
      ieee1394/csr1212: fix false positive kmemcheck report
      kmemcheck: annotate inet_timewait_sock bitfields
      kmemcheck: disable fast string operations on P4 CPUs
      kmemcheck: rip out REP instruction emulation
      kmemcheck: add hooks for page- and sg-dma-mappings
      kmemcheck: don't track allocated page tables
      kmemcheck: add hooks for the page allocator
      kmemcheck: depend on !SLUB_DEBUG_ON

 arch/x86/Kconfig.debug             |    2 +-
 arch/x86/include/asm/dma-mapping.h |    6 ++
 arch/x86/include/asm/thread_info.h |    4 +-
 arch/x86/kernel/cpu/intel.c        |   23 +++++++
 arch/x86/mm/kmemcheck/kmemcheck.c  |  121 +-----------------------------------
 arch/x86/mm/kmemcheck/opcode.c     |   13 +----
 arch/x86/mm/kmemcheck/opcode.h     |    3 +-
 arch/x86/mm/kmemcheck/shadow.c     |    8 +++
 arch/x86/mm/pgtable.c              |   12 ++--
 drivers/ieee1394/csr1212.c         |    2 +
 drivers/ieee1394/nodemgr.c         |    7 ++-
 include/linux/gfp.h                |    5 ++
 include/linux/kmemcheck.h          |   72 ++++++++++++++++++++--
 include/linux/skbuff.h             |   33 ++++++----
 include/net/inet_sock.h            |   26 +++++---
 include/net/inet_timewait_sock.h   |   11 ++-
 mm/kmemcheck.c                     |   45 ++++++++++----
 mm/page_alloc.c                    |    8 +++
 mm/slab.c                          |   15 +++--
 mm/slub.c                          |   23 +++++--
 net/core/skbuff.c                  |    8 +++
 net/ipv4/inet_timewait_sock.c      |    3 +
 22 files changed, 252 insertions(+), 198 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [GIT PULL] kmemcheck updates for -tip
@ 2009-02-26 14:01 Vegard Nossum
  2009-02-26 15:23 ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: Vegard Nossum @ 2009-02-26 14:01 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Pekka Enberg, linux-kernel

Hi,

The following changes since commit 8f5bd505f147bcd57c627e8599cbcc6b082312d4:
  Ingo Molnar (1):
        Merge branch 'for-tip' of git://git.kernel.org/.../vegard/kmemcheck into kmemcheck

are available in the git repository at:

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

Pekka Enberg (7):
      kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
      kmemcheck: remove forward declarations from error.c
      kmemcheck: make initialization message less confusing
      kmemcheck: remove multiple ifdef'd definitions of the same global variable
      kmemcheck: move 64-bit ifdef out of kmemcheck_opcode_decode()
      kmemcheck: missing whitespace in do_page_fault()
      kmemcheck: use kmemcheck_pte_lookup() instead of open-coding it

Vegard Nossum (9):
      kmemcheck: fix an incorrect BUG_ON()
      kmemcheck: fix shadow updates that cross page boundaries
      crypto: don't track xor test pages with kmemcheck
      x86: don't use MMX/SSE in xor routines if kmemcheck is compiled in
      kmemcheck: reverse dependencies between DEBUG_PAGEALLOC and KMEMCHECK
      kmemcheck: depend on DEBUG_KERNEL
      c2port: annotate bitfield for kmemcheck
      kmemcheck (bitfields): don't actually initialize the bitfield
      net: annotate struct sock bitfield

 arch/x86/Kconfig.debug            |    6 +-
 arch/x86/include/asm/xor.h        |    5 ++
 arch/x86/mm/fault.c               |    2 +-
 arch/x86/mm/kmemcheck/error.c     |  137 ++++++++++++++++++-------------------
 arch/x86/mm/kmemcheck/kmemcheck.c |   20 ++---
 arch/x86/mm/kmemcheck/opcode.c    |    9 ++-
 arch/x86/mm/kmemcheck/shadow.c    |   38 +++++++++-
 crypto/xor.c                      |    7 ++-
 drivers/misc/c2port/core.c        |    2 +
 include/linux/c2port.h            |    7 ++-
 include/linux/kmemcheck.h         |    6 +-
 include/net/sock.h                |    8 ++-
 lib/Kconfig.debug                 |    4 +-
 net/core/sock.c                   |    2 +
 14 files changed, 151 insertions(+), 102 deletions(-)


Vegard

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [git pull] kmemcheck updates for -tip
@ 2008-07-01 20:18 Vegard Nossum
  2008-07-01 20:24 ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: Vegard Nossum @ 2008-07-01 20:18 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Pekka Enberg, linux-kernel

Hi Ingo,

Please pull the 'for-tip' branch of

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

to receive the following changes:

Vegard Nossum (3):
      kmemcheck: fix sparse warnings
      softirq: raise the right softirq
      kmemcheck: use the proper comment style

 arch/x86/mm/kmemcheck/error.c     |    1 +
 arch/x86/mm/kmemcheck/kmemcheck.c |   26 +++++++++++++++++---------
 arch/x86/mm/kmemcheck/opcode.c    |    6 ++++--
 arch/x86/mm/kmemcheck/shadow.c    |    1 +
 arch/x86/mm/kmemcheck/string.c    |   12 ++++++++----
 include/linux/kmemcheck.h         |    1 +
 kernel/softirq.c                  |    2 +-
 7 files changed, 33 insertions(+), 16 deletions(-)


Thanks,

Vegard


diff --git a/arch/x86/mm/kmemcheck/error.c b/arch/x86/mm/kmemcheck/error.c
index 9261f9c..56410c6 100644
--- a/arch/x86/mm/kmemcheck/error.c
+++ b/arch/x86/mm/kmemcheck/error.c
@@ -6,6 +6,7 @@
 #include <linux/stacktrace.h>
 #include <linux/string.h>
 
+#include "error.h"
 #include "shadow.h"
 
 enum kmemcheck_error_type {
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
index 0c0201b..37949c3 100644
--- a/arch/x86/mm/kmemcheck/kmemcheck.c
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -39,8 +39,10 @@ void __init kmemcheck_init(void)
 	kmemcheck_smp_init();
 
 #if defined(CONFIG_SMP) && !defined(CONFIG_KMEMCHECK_USE_SMP)
-	/* Limit SMP to use a single CPU. We rely on the fact that this code
-	* runs before SMP is set up. */
+	/*
+	 * Limit SMP to use a single CPU. We rely on the fact that this code
+	 * runs before SMP is set up.
+	 */
 	if (setup_max_cpus > 1) {
 		printk(KERN_INFO
 			"kmemcheck: Limiting number of CPUs to 1.\n");
@@ -144,8 +146,10 @@ void kmemcheck_show(struct pt_regs *regs)
 	n += kmemcheck_show_addr(data->addr1);
 	n += kmemcheck_show_addr(data->addr2);
 
-	/* None of the addresses actually belonged to kmemcheck. Note that
-	 * this is not an error. */
+	/*
+	 * None of the addresses actually belonged to kmemcheck. Note that
+	 * this is not an error.
+	 */
 	if (n == 0) {
 		kmemcheck_resume();
 		return;
@@ -348,7 +352,7 @@ enum kmemcheck_method {
 	KMEMCHECK_WRITE,
 };
 
-void kmemcheck_access(struct pt_regs *regs,
+static void kmemcheck_access(struct pt_regs *regs,
 	unsigned long fallback_address, enum kmemcheck_method fallback_method)
 {
 	const uint8_t *insn;
@@ -414,8 +418,10 @@ void kmemcheck_access(struct pt_regs *regs,
 		/* MOVS, MOVSB, MOVSW, MOVSD */
 	case 0xa4:
 	case 0xa5:
-		/* These instructions are special because they take two
-		 * addresses, but we only get one page fault. */
+		/*
+		 * These instructions are special because they take two
+		 * addresses, but we only get one page fault.
+		 */
 		kmemcheck_read(regs, regs->si, size);
 		kmemcheck_write(regs, regs->di, size);
 		data->addr1 = regs->si;
@@ -434,9 +440,11 @@ void kmemcheck_access(struct pt_regs *regs,
 		return;
 	}
 
-	/* If the opcode isn't special in any way, we use the data from the
+	/*
+	 * If the opcode isn't special in any way, we use the data from the
 	 * page fault handler to determine the address and type of memory
-	 * access. */
+	 * access.
+	 */
 	switch (fallback_method) {
 	case KMEMCHECK_READ:
 		kmemcheck_read(regs, fallback_address, size);
diff --git a/arch/x86/mm/kmemcheck/opcode.c b/arch/x86/mm/kmemcheck/opcode.c
index be0c8b7..194aeee 100644
--- a/arch/x86/mm/kmemcheck/opcode.c
+++ b/arch/x86/mm/kmemcheck/opcode.c
@@ -21,10 +21,12 @@ static bool opcode_is_rex_prefix(uint8_t b)
 	return (b & 0xf0) == 0x40;
 }
 
-/* This is a VERY crude opcode decoder. We only need to find the size of the
+/*
+ * This is a VERY crude opcode decoder. We only need to find the size of the
  * load/store that caused our #PF and this should work for all the opcodes
  * that we care about. Moreover, the ones who invented this instruction set
- * should be shot. */
+ * should be shot.
+ */
 unsigned int kmemcheck_opcode_get_size(const uint8_t *op)
 {
 	/* Default operand size */
diff --git a/arch/x86/mm/kmemcheck/shadow.c b/arch/x86/mm/kmemcheck/shadow.c
index 07ed3d6..0cb144f 100644
--- a/arch/x86/mm/kmemcheck/shadow.c
+++ b/arch/x86/mm/kmemcheck/shadow.c
@@ -1,3 +1,4 @@
+#include <linux/kmemcheck.h>
 #include <linux/mm.h>
 
 #include <asm/page.h>
diff --git a/arch/x86/mm/kmemcheck/string.c b/arch/x86/mm/kmemcheck/string.c
index 0d21d22..1a62bf0 100644
--- a/arch/x86/mm/kmemcheck/string.c
+++ b/arch/x86/mm/kmemcheck/string.c
@@ -27,8 +27,10 @@ static void memset_one_page(void *s, int c, size_t n)
 		return;
 	}
 
-	/* While we are not guarding the page in question, nobody else
-	 * should be able to change them. */
+	/*
+	 * While we are not guarding the page in question, nobody else
+	 * should be able to change them.
+	 */
 	local_irq_save(flags);
 
 	kmemcheck_pause_allbutself();
@@ -68,8 +70,10 @@ void *kmemcheck_memset(void *s, int c, size_t n)
 	end_page = (addr + n) & PAGE_MASK;
 
 	if (start_page == end_page) {
-		/* The entire area is within the same page. Good, we only
-		 * need one memset(). */
+		/*
+		 * The entire area is within the same page. Good, we only
+		 * need one memset().
+		 */
 		memset_one_page(s, c, n);
 		return s;
 	}
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h
index bc02c3f..b2d83ef 100644
--- a/include/linux/kmemcheck.h
+++ b/include/linux/kmemcheck.h
@@ -1,6 +1,7 @@
 #ifndef LINUX_KMEMCHECK_H
 #define LINUX_KMEMCHECK_H
 
+#include <linux/mm_types.h>
 #include <linux/types.h>
 
 #ifdef CONFIG_KMEMCHECK
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 44cf21f..23dc889 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -399,7 +399,7 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t)
 
 	t->next = __get_cpu_var(tasklet_hi_vec).head;
 	__get_cpu_var(tasklet_hi_vec).head = t;
-	__raise_softirq_irqoff(TASKLET_SOFTIRQ);
+	__raise_softirq_irqoff(HI_SOFTIRQ);
 }
 
 EXPORT_SYMBOL(__tasklet_hi_schedule_first);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-02-26 15:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-22 13:57 [GIT PULL] kmemcheck updates for -tip Vegard Nossum
2009-02-22 16:44 ` Ingo Molnar
2009-02-22 17:00   ` Frederic Weisbecker
2009-02-22 17:05     ` Sitsofe Wheeler
2009-02-22 17:06     ` Vegard Nossum
  -- strict thread matches above, loose matches on Subject: below --
2009-02-26 14:01 Vegard Nossum
2009-02-26 15:23 ` Ingo Molnar
2008-07-01 20:18 [git pull] " Vegard Nossum
2008-07-01 20:24 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox