Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5651543img; Wed, 27 Mar 2019 12:28:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnQMAp6DsbYPARL9qc6XL9hh6NRDHovf6qLD6EYKln0yxRDyJfLLmgXJ9/tUAdozgu2IlN X-Received: by 2002:a63:c34a:: with SMTP id e10mr35784617pgd.194.1553714907559; Wed, 27 Mar 2019 12:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714907; cv=none; d=google.com; s=arc-20160816; b=sVRBL6T/NLGJ95SODhVsILw+8QHFQ0O11jDxnjn8NUpIeH+CNkyKrnxE/gGp9OMpDR i/nRroopBXgexD7hfBAjeQvw334REF+/vFhyXIvdf52rWi+1tS7JVCpB/GBbr7SfJVFw THdZGCzmHOOmSNUZdd1rj55S4gfWJdLZrEJNh0EOHnrmijPeIZuiv7P8rpLz2uoBDVBb KtOf0n/4lmnlwDKaK7sHwuO4fq+c5GH84CI5MFH+O5/33Dvq1TMoiyFNtI5sV4qFUVf9 wiIH+tW25i9YiSDmJrfCGQWZuhTfIZMoRX8VubbCmB0xWyhdARHBkJ+Cp1lXkpgryBu7 h5+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eucx/0GOeflLGVT5NXCMRwTFjDoa3IzdMSp8J2Z2KYg=; b=WWQ0zkxnW7ZQGIuHSoF26pyWK0iHJo15G+Sja4AYryJnQVjktba7eDjPzfTuX69MWO gXgKt49O1qc0JsUm49/n4iZqB0vNdmZo8Q7gF27ViDv8lCV5wNXkBK6cM8Emu2fLgMtu dkYDQdjKAE+dnIkiRlJ7NNdDWNYvOtHDVJQXNsGd/qtPblZVA+OMOUsWk0W7eF+axJQ2 lDiFgOQ2CKzlp1SaJzJiwWsb7PERU+XEVEkymYAa+2vAi7Xod2Jro+6R+Sj7xC5Ts75v C0o6MfpHMgNbadVsCpMnYsmUljdcjc2MvF25el+q8go8LVlAq7jWH899bAeAuO4b1tJZ ppsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WrrI64lD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r184si1721167pgr.24.2019.03.27.12.28.12; Wed, 27 Mar 2019 12:28:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WrrI64lD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387418AbfC0SEl (ORCPT + 99 others); Wed, 27 Mar 2019 14:04:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:45390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731614AbfC0SEk (ORCPT ); Wed, 27 Mar 2019 14:04:40 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA036217F9; Wed, 27 Mar 2019 18:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709879; bh=p/JPAeHQeGtz0cMvYXV8FwKb6w0whMtDar6nkW38xlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WrrI64lDKyD4ZQ2kKuHjggGb2TKMQUGKAugUAerlLtCovJavce5UG48JA5z5s2pm6 oZvh+6/LAq1huYTLjukZCvhfS6BmTyahJ+VAOYUuEA7P7wVl6L/u95LY/G4LWLV7VN rhkGTsZJoUYugwbzuNo5T9nhQeTzBGC+95LQ5sag= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicolas Boichat , Joerg Roedel , Sasha Levin , iommu@lists.linux-foundation.org Subject: [PATCH AUTOSEL 5.0 085/262] iommu/io-pgtable-arm-v7s: Only kmemleak_ignore L2 tables Date: Wed, 27 Mar 2019 13:59:00 -0400 Message-Id: <20190327180158.10245-85-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Boichat [ Upstream commit 032ebd8548c9d05e8d2bdc7a7ec2fe29454b0ad0 ] L1 tables are allocated with __get_dma_pages, and therefore already ignored by kmemleak. Without this, the kernel would print this error message on boot, when the first L1 table is allocated: [ 2.810533] kmemleak: Trying to color unknown object at 0xffffffd652388000 as Black [ 2.818190] CPU: 5 PID: 39 Comm: kworker/5:0 Tainted: G S 4.19.16 #8 [ 2.831227] Workqueue: events deferred_probe_work_func [ 2.836353] Call trace: ... [ 2.852532] paint_ptr+0xa0/0xa8 [ 2.855750] kmemleak_ignore+0x38/0x6c [ 2.859490] __arm_v7s_alloc_table+0x168/0x1f4 [ 2.863922] arm_v7s_alloc_pgtable+0x114/0x17c [ 2.868354] alloc_io_pgtable_ops+0x3c/0x78 ... Fixes: e5fc9753b1a8314 ("iommu/io-pgtable: Add ARMv7 short descriptor support") Signed-off-by: Nicolas Boichat Acked-by: Will Deacon Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/io-pgtable-arm-v7s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index cec29bf45c9b..98a4a4a0dfb0 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -217,7 +217,8 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp, if (dma != phys) goto out_unmap; } - kmemleak_ignore(table); + if (lvl == 2) + kmemleak_ignore(table); return table; out_unmap: -- 2.19.1