]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
kmemleak: Ignore the aperture memory hole on x86_64
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 27 Aug 2009 13:29:20 +0000 (14:29 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 1 Sep 2009 10:12:32 +0000 (11:12 +0100)
This block is allocated with alloc_bootmem() and scanned by kmemleak but
the kernel direct mapping may no longer exist. This patch tells kmemleak
to ignore this memory hole. The dma32_bootmem_ptr in
dma32_reserve_bootmem() is also ignored.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/aperture_64.c
arch/x86/kernel/pci-dma.c

index 676debfc1702346939a5f17423e6a706f7e69886..128111d8ffe0de7ffcdaf0891221ff37d0ae61f8 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/bitops.h>
 #include <linux/ioport.h>
 #include <linux/suspend.h>
+#include <linux/kmemleak.h>
 #include <asm/e820.h>
 #include <asm/io.h>
 #include <asm/iommu.h>
@@ -94,6 +95,11 @@ static u32 __init allocate_aperture(void)
         * code for safe
         */
        p = __alloc_bootmem_nopanic(aper_size, aper_size, 512ULL<<20);
+       /*
+        * Kmemleak should not scan this block as it may not be mapped via the
+        * kernel direct mapping.
+        */
+       kmemleak_ignore(p);
        if (!p || __pa(p)+aper_size > 0xffffffff) {
                printk(KERN_ERR
                        "Cannot allocate aperture memory hole (%p,%uK)\n",
index 1a041bcf506bd8efd0d27a4e99e2003e07ff6445..fa80f60e9607db49e4ed1b3266869d961828afe9 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/dmar.h>
 #include <linux/bootmem.h>
 #include <linux/pci.h>
+#include <linux/kmemleak.h>
 
 #include <asm/proto.h>
 #include <asm/dma.h>
@@ -88,6 +89,11 @@ void __init dma32_reserve_bootmem(void)
        size = roundup(dma32_bootmem_size, align);
        dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
                                 512ULL<<20);
+       /*
+        * Kmemleak should not scan this block as it may not be mapped via the
+        * kernel direct mapping.
+        */
+       kmemleak_ignore(dma32_bootmem_ptr);
        if (dma32_bootmem_ptr)
                dma32_bootmem_size = size;
        else