From patchwork Thu Aug 8 09:37:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 2840919 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 041499F493 for ; Thu, 8 Aug 2013 09:40:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBB0020431 for ; Thu, 8 Aug 2013 09:40:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BEF412042B for ; Thu, 8 Aug 2013 09:40:20 +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 1V7MgZ-0001XK-UJ; Thu, 08 Aug 2013 09:39:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7Mg3-0004yb-Go; Thu, 08 Aug 2013 09:38:39 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7Mfa-0004rJ-GI for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2013 09:38:13 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MR700BVIHECWW90@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2013 18:37:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 68.15.03969.FD663025; Thu, 08 Aug 2013 18:37:35 +0900 (KST) X-AuditID: cbfee68f-b7f436d000000f81-24-520366df687d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4C.0D.31505.ED663025; Thu, 08 Aug 2013 18:37:35 +0900 (KST) Received: from DOPULLIPCHO07 ([12.23.118.94]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MR7002ZQHEMH140@mmp1.samsung.com>; Thu, 08 Aug 2013 18:37:34 +0900 (KST) From: Cho KyongHo To: 'Linux ARM Kernel' , 'Linux IOMMU' , 'Linux Kernel' , 'Linux Samsung SOC' , devicetree@vger.kernel.org Subject: [PATCH v9 02/16] iommu/exynos: add missing cache flush for removed page table entries Date: Thu, 08 Aug 2013 18:37:34 +0900 Message-id: <002601ce941a$e987ba50$bc972ef0$@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac6UF1PC6SL3HdCxRB+a1f/jcy5kvg== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42I5/e+Zke79NOYgg8U9rBZ37p5jtZh/BEi8 OvKDyWLBfmuLztkb2C16F1xls/h46ji7xabH11gtLu+aw2Yx4/w+JosLKzayW0xZdJjV4uSf XkaLluu9TA58Hk8OzmPymN1wkcXjzrU9bB7nN61h9ti8pN5j8o3ljB59W1YxenzeJOdx5egZ pgDOKC6blNSczLLUIn27BK6MzltP2QsWclZMmHuCtYHxJnsXIweHhICJxKrDZl2MnECmmMSF e+vZuhi5OIQEljFK7L//hBUiYSJx5PpKFojEIkaJ3p41TBDOX0aJR1OvMYNUsQloSayee5wR JCEi8JtR4tazOawgDrPAfyaJrbeb2EGqhAUSJGZcW8IGYrMIqErsO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IgJ7Egn0T2CBqRCT2vXjHOIFR YBaSUbOQjJqFZNQsJC0LGFlWMYqmFiQXFCel5xrpFSfmFpfmpesl5+duYgSnlmfSOxhXNVgc YhTgYFTi4V3oxhwkxJpYVlyZe4hRgoNZSYT3YjFTkBBvSmJlVWpRfnxRaU5q8SHGZKBPJzJL iSbnA9NeXkm8obGJmZGlkZmFkYm5OWnCSuK8B1utA4UE0hNLUrNTUwtSi2C2MHFwSjUwruC8 W3ksrmPKfNEJLYLydlvEpM4UL90XPSXBzEf+m+C6+0WLLnbcv/bz2bSAEMcnPS91K/LzNSMn FEzff0v8+Sefy+r/GflDv5b12dVejrzZu9z62dQl1etfO92YFXSbvTzcxrv4zrMVAXlMp8P0 9TgqJFZIx9b3LRC7kCBwIPG1sckntt9mSizFGYmGWsxFxYkAjvTXL3EDAAA= 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-20130808_053810_840998_D64934F3 X-CRM114-Status: UNSURE ( 8.24 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.1 (-----) Cc: 'Kukjin Kim' , 'Prathyush' , 'Grant Grundler' , 'Joerg Roedel' , 'Subash Patel' , 'Sachin Kamat' , 'Antonios Motakis' , kvmarm@lists.cs.columbia.edu, '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=-2.4 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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. Tested-by: Grant Grundler Signed-off-by: Cho KyongHo Reviewed-by: Tomasz Figa --- drivers/iommu/exynos-iommu.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 233f382..d545a25 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1002,6 +1002,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; } @@ -1010,6 +1011,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;