Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5615891img; Wed, 27 Mar 2019 11:46:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXv9g6mIOr5L1XIaeUXVDv0/vPlucq9tzD4YxcyFJnCYPR6VrhUy91aWA6iBcdsHV0XEPM X-Received: by 2002:a63:5c5e:: with SMTP id n30mr35230146pgm.298.1553712400355; Wed, 27 Mar 2019 11:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712400; cv=none; d=google.com; s=arc-20160816; b=poQ/EUjSn03FHRJhNShN+xEqLX5zpgRU2GQuCgycaZI3CTowTy2M2R3BRRoFFSMC3G z/HW8oKpuK4/2b6YzUVHT9ICwpBmSzI138HqdQLa3n1L9cw48iX/PbRw6X6GMJd1RMEc JwGHlEX7iNTDjfN47xehVgHvBVP7pB9XmxntAgavFE4aUE1HTmVLSpMRZRjpjPqN7pkx d/bxE8n9jvOQSxd9hQjU0yK8Lt9TfYogLYpWfruo5NidJORZ3WQvw1HLY5TdoCpHoSin DzuWc/mfsOWZZwOm+as/xMj8ASfEhnR0OAhmZbyzZmxTpytpTcHMNM9Svc0msfQwWLsO FCNQ== 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=ZQ/vtbaEFN6zXEtFbQLPKeH8O3v11KpPPev243w7iEU=; b=tSdYFWVPDXvHcPnGZBiBsZGhY/AcsVzbQeiXvk5rYPI2CJvevf9NmaYsB/PKePWkat 2zuZEHnkkYyjFLJW+RXMLxKhGwQEOn3w7jDWj3mCRzSjaJ/xXDTWwjYBhVztFABgPW/r 3CE3fDS0c2PQTSv1nVPCpeoJeRKDV6gYaSzXv9+mW32SFOn3nJGEwl6/R9hW8TyDLQGA +XgLY5Gq0rI7EcI4P2GSOzBBHT2ArENw7TH4CI5S+dXP25NXUNVlJqxy49TUyHDYdp0l rlzbBC3zcDfKg43gIcxPD5nrF1d2ysV09M3hist9/5i/HMh2PQT3cGSCJEF9BZtDJvOt 5Ing== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MCpEM86X; 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 u2si18652289pgp.549.2019.03.27.11.46.24; Wed, 27 Mar 2019 11:46:40 -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=MCpEM86X; 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 S2391447AbfC0Sno (ORCPT + 99 others); Wed, 27 Mar 2019 14:43:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:39404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391188AbfC0SVb (ORCPT ); Wed, 27 Mar 2019 14:21:31 -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 E464720651; Wed, 27 Mar 2019 18:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710890; bh=2LOZ6A76XpqH99uMSSpJhUhCWEBhsNKuXxUPC2QpjxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MCpEM86XIkMcYPBA8L8R6v/K355GvZ2+ATChjACF8bfVgxyCa+kkXFEA0qraE8Ft7 4DVQ51LWUCNHxFnVxm5st9DbUb7elw1q3z/0kEIJBSFwdxoxIT7BgpqOft/o66+pRM zGi1XPxh4mjH4Q3Y67heAmJjgzcd1FksEGBPT3Bs= 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 4.9 30/87] iommu/io-pgtable-arm-v7s: Only kmemleak_ignore L2 tables Date: Wed, 27 Mar 2019 14:19:43 -0400 Message-Id: <20190327182040.17444-30-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-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 d68a552cfe8d..3085b47fac1d 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -207,7 +207,8 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp, if (dma != virt_to_phys(table)) goto out_unmap; } - kmemleak_ignore(table); + if (lvl == 2) + kmemleak_ignore(table); return table; out_unmap: -- 2.19.1