From patchwork Mon Oct 7 01:52:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 2993581 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 636ED9F243 for ; Mon, 7 Oct 2013 01:53:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90C42201D3 for ; Mon, 7 Oct 2013 01:53:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC1D2201C4 for ; Mon, 7 Oct 2013 01:53:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059Ab3JGBws (ORCPT ); Sun, 6 Oct 2013 21:52:48 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:13020 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953Ab3JGBwp (ORCPT ); Sun, 6 Oct 2013 21:52:45 -0400 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 <0MU90029HZTJ28A0@mailout3.samsung.com>; Mon, 07 Oct 2013 10:52:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 38.E8.31253.CE312525; Mon, 07 Oct 2013 10:52:44 +0900 (KST) X-AuditID: cbfee690-b7f3b6d000007a15-75-525213ecc984 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 27.CD.05832.CE312525; Mon, 07 Oct 2013 10:52:44 +0900 (KST) Received: from DO-PULLIP-CHO07.dsn.sec.samsung.com ([12.23.118.94]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MU900FYEZVVXX00@mmp2.samsung.com>; Mon, 07 Oct 2013 10:52:44 +0900 (KST) Date: Mon, 07 Oct 2013 10:52:43 +0900 From: Cho KyongHo To: Linux ARM Kernel , Linux DeviceTree , Linux IOMMU , Linux Kernel , Linux Samsung SOC Cc: Antonios Motakis , Grant Grundler , Joerg Roedel , Kukjin Kim , Prathyush , Rahul Sharma , Sachin Kamat , Subash Patel , Varun Sethi , Sylwester Nawrocki , Tomasz Figa Subject: [PATCH v10 02/20] iommu/exynos: add missing cache flush for removed page table entries Message-id: <20131007105243.bfb2983f50d37183d3362f14@samsung.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRmVeSWpSXmKPExsVy+t8zI903wkFBBi97JS3u3D3HajH/CJB4 deQHk8WC/dYWnbM3sFv0LrjKZrHp8TVWi8u75rBZzDi/j8niwoqN7BZTFh1mtTj8pp3V4uSf XkaLluu9TBbrZ7xmsZh5aw2Lg4DHk4PzmDxmN1xk8fh3uJ/J4861PWwem5fUe0y+sZzRo2/L KkaPz5vkPK4cPcMUwBnFZZOSmpNZllqkb5fAlfH93ivGglOcFTtu7mZuYPzP3sXIySEhYCIx bd09RghbTOLCvfVsILaQwDJGievf/WBqLk09zdLFyAUUn84osa7jFhOEM4lJ4n/vCrBJLAKq EjdW3WEFsdkEtCRWzz3OCFIkItDGJPG18RBYO7PAaWaJVbtXMINUCQskSpzeOZkFxOYVcJT4 saCDGWKfhcSFpg52iLigxI/J98BqmIGmbt7WxAphy0tsXvOWGWSohMBEDokN3S9ZIc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cWVuYcYJTiYlUR4L9UBhXhTEiurUovy44tKc1KLDzEmA/09kVlKNDkfmMTySuINjU3M jCyNzCyMTMzNSRNWEuc92GodKCSQnliSmp2aWpBaBLOFiYNTqoExKXv51qojT0qkC+T7WcUP hzycaPT3+ym93ta58fMMpn+ce1iMm40zcaN/wVLnZ+d+2/yM8zHcqzghLNRVdFW6QPWFmWtm R880+WTsvellyqJrHc0t2WFBmo/av1bvlnzYKXc66FDW/L2tD0q0nk85sNxObIW3M+f2SC3d OPkNSyzPTmQ9KymoxFKckWioxVxUnAgAHGB2TlgDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 files changed, 2 insertions(+), 0 deletions(-) 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;