Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759743AbbKTLJe (ORCPT ); Fri, 20 Nov 2015 06:09:34 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38584 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759620AbbKTLJc (ORCPT ); Fri, 20 Nov 2015 06:09:32 -0500 To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org From: Michael Wang Subject: [RFC PATCH] iommu/amd: make kmemleak ignore the 'irq_remap_table' object Message-ID: <564EFF6A.2050709@profitbricks.com> Date: Fri, 20 Nov 2015 12:09:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1662 Lines: 46 The kmemleak testing on 3.18.24 show: unreferenced object 0xffff880233ff9010 (size 16): comm "swapper/0", pid 1, jiffies 4294937440 (age 2010.490s) hex dump (first 16 bytes): 0a 0a 00 00 20 00 00 00 00 44 fb 33 02 88 ff ff .... ....D.3.... backtrace: [] create_object+0x10d/0x2d0 [] kmemleak_alloc+0x5b/0xc0 [] kmem_cache_alloc_trace+0xb9/0x160 [] get_irq_table+0x151/0x380 This is caused by the 'irq_lookup_table' was allocated with __get_free_pages() which won't create kmemleak object, thus it's pointers won't be count as referencing in kmemleak scanning. The 'irq_remap_table' allocated won't be freed after initialized, doesn't make sense to let kmemleak scan it. This patch mark the 'irq_remap_table' object as 'ignored' to stop the 'false positives' report. Signed-off-by: Michael Wang --- drivers/iommu/amd_iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 8b2be1e..87a1a88 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -3603,6 +3603,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) } irq_lookup_table[devid] = table; + kmemleak_ignore(table); set_dte_irq_entry(devid, table); iommu_flush_dte(iommu, devid); if (devid != alias) { -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/