From patchwork Fri Mar 14 05:02:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 3830201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 25DEC9F72D for ; Fri, 14 Mar 2014 05:03:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5943F20320 for ; Fri, 14 Mar 2014 05:03:09 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C58D92034A for ; Fri, 14 Mar 2014 05:03:07 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKGt-0007VS-9n; Fri, 14 Mar 2014 05:03:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKGq-0008FM-RR; Fri, 14 Mar 2014 05:03:00 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKGn-0008Dj-1c for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 05:02:57 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2E00E9JU0A4M30@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 14:02:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id A8.A9.10364.A6D82235; Fri, 14 Mar 2014 14:02:34 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-7f-53228d6a2ac4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id CE.E0.28157.A6D82235; Fri, 14 Mar 2014 14:02:34 +0900 (KST) Received: from DO-PULLIP-CHO07.dsn.sec.samsung.com ([12.36.165.149]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2E00EXMU0AWK50@mmp2.samsung.com>; Fri, 14 Mar 2014 14:02:34 +0900 (KST) Date: Fri, 14 Mar 2014 14:02:34 +0900 From: Cho KyongHo To: Linux ARM Kernel , Linux DeviceTree , Linux IOMMU , Linux Kernel , Linux Samsung SOC Subject: [PATCH v11 02/27] iommu/exynos: add missing cache flush for removed page table entries Message-id: <20140314140234.c972b52a96a4fe39acd09fe0@samsung.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRmVeSWpSXmKPExsVy+t8zI92sXqVgg2O3TSzu3D3HajH/CJB4 deQHk8WC/dYWnbM3sFv0LrjKZrHp8TVWi8u75rBZzDi/j8niwoqN7BZTFh1mtTj8pp3V4uSf XkaL9TNes1jMvLWGxYHf48nBeUwesxsusnj8O9zP5HHn2h42j81L6j0m31jO6NG3ZRWjx+dN ch5Xjp5hCuCM4rJJSc3JLEst0rdL4MpYNus5e8FOzoq+zyfYGhg/sHcxcnJICJhI/GuaCWWL SVy4t56ti5GLQ0hgGaPEkoNHWWGKpn44wAKRmM4ocbvpEVTVZCaJJYsOMYJUsQioSizb3QQ2 ik1AS2L13OOMIEUiAm1MEl8bD4G1MwvMZZZ4tvYp2Fxh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ZQsYmVcx iqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBKeHZ9I7GFc1WBxiFOBgVOLhnXFUMViINbGsuDL3 EKMEB7OSCG9VhFKwEG9KYmVValF+fFFpTmrxIcZkoL8nMkuJJucDU1deSbyhsYmZkaWRmYWR ibk5acJK4rwHW60DhQTSE0tSs1NTC1KLYLYwcXBKNTCKJvofk7G6v4AlKPOYrd/JtX5WX/nf 3VWcyJT7e57PzxaLzJW17xffXaEQ4dquFHVXJF056NOhq8/8+HXCPv0XzzZI7vgwJ0suNtqv VIxr1oflJySzN3xz0L1wu6bW6GH51s/7Go+6bu5QeuUnZr9Hqm26cVq89lyn803HJx/y6ZH4 qvJzt4wSS3FGoqEWc1FxIgBg3jW4UwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_010257_348418_CDDE519F X-CRM114-Status: UNSURE ( 8.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: Kukjin Kim , Prathyush , Grant Grundler , Joerg Roedel , Sachin Kamat , Sylwester Nawrocki , Varun Sethi , Antonios Motakis , Tomasz Figa , Rahul Sharma X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit adds cache flush for removed small and large page entries in exynos_iommu_unmap(). Missing cache flush of removed page table entries can cause missing page fault interrupt when a master IP accesses an unmapped area. Reviewed-by: Tomasz Figa Tested-by: Grant Grundler Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 4876d35..1c3a397 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -958,6 +958,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, if (lv2ent_small(ent)) { *ent = 0; size = SPAGE_SIZE; + pgtable_flush(ent, ent + 1); priv->lv2entcnt[lv1ent_offset(iova)] += 1; goto done; } @@ -966,6 +967,7 @@ static size_t exynos_iommu_unmap(struct iommu_domain *domain, BUG_ON(size < LPAGE_SIZE); memset(ent, 0, sizeof(*ent) * SPAGES_PER_LPAGE); + pgtable_flush(ent, ent + SPAGES_PER_LPAGE); size = LPAGE_SIZE; priv->lv2entcnt[lv1ent_offset(iova)] += SPAGES_PER_LPAGE;