From patchwork Fri Jul 26 11:26:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 2833991 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 5C0D19F243 for ; Fri, 26 Jul 2013 11:27:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D99A20179 for ; Fri, 26 Jul 2013 11:27:09 +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 EFD2620176 for ; Fri, 26 Jul 2013 11:27: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 1V2gAc-0000ZY-3Y; Fri, 26 Jul 2013 11:26:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2gAX-0005iw-0P; Fri, 26 Jul 2013 11:26:45 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2gAM-0005f2-2T for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 11:26:34 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MQJ00LWVJS4D6P0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 20:26:28 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 05.69.03969.4EC52F15; Fri, 26 Jul 2013 20:26:28 +0900 (KST) X-AuditID: cbfee68f-b7f436d000000f81-cb-51f25ce409ee Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 55.3C.31505.4EC52F15; Fri, 26 Jul 2013 20:26:28 +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 <0MQJ001EJJS4EW30@mmp1.samsung.com>; Fri, 26 Jul 2013 20:26:28 +0900 (KST) From: Cho KyongHo To: 'Linux ARM Kernel' , 'Linux IOMMU' , 'Linux Kernel' , 'Linux Samsung SOC' Subject: [PATCH v8 02/12] iommu/exynos: add missing cache flush for removed page table entries Date: Fri, 26 Jul 2013 20:26:28 +0900 Message-id: <003801ce89f2$f8952d20$e9bf8760$@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac6J8Y6Vw9vEup31TMq2rYuDqttIbQ== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42I5/e+Zke6TmE+BBjt/GlncuXuO1eLVkR9M Fgv2W1t0zt7AbrH54DoWi94FV9ksGu9NYLP4eOo4u8Wmx9dYLS7vmsNmMeP8PiaLCys2sltM WXSY1eLkn15Gi5brvUwO/B5PDs5j8pjdcJHF4861PWwe5zetYfbYvKTeY/KN5YwefVtWMXp8 3iTnceXoGaYAzigum5TUnMyy1CJ9uwSujOtb77IVvOWouLh7AUsD42r2LkZODgkBE4n+OX+g bDGJC/fWs4HYQgLLGCXmTrGGqWl/+om1i5ELKL6IUeLM1afsEM5fRomjm6+zglSxCWhJrJ57 nBHEFhG4yyjx8jwPSBGzwG1miWk/X4ElhAUSJGYfXc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GpEJPa9eMc4 gVFgFpJRs5CMmoVk1CwkLQsYWVYxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBCeZZ9I7GFc1 WBxiFOBgVOLhVXD6GCjEmlhWXJl7iFGCg1lJhPe696dAId6UxMqq1KL8+KLSnNTiQ4zJQJ9O ZJYSTc4HJsC8knhDYxMzI0sjMwsjE3Nz0oSVxHkPtloHCgmkJ5akZqemFqQWwWxh4uCUamDU /PVpn+XaJQoPjl+smHlIbpaDYeGHl9fP5h0WNTzmlVdpa/lfRjvhsfzFCL8LdlnRD1MXpuw6 0Mpx6cX24P2uc95PT2DQ8fSa8lbDrsss/TzHTZkPV/i/l2Xe+/zQJofx/AbLzPeWp5I0WgP4 LhqKxVypvVXqKGTI6GCz/+PZK+cnmYhf545WYinOSDTUYi4qTgQA2YL6pXYDAAA= 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-20130726_072634_353877_7DEEAE24 X-CRM114-Status: UNSURE ( 8.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -8.3 (--------) Cc: 'Kukjin Kim' , 'Hyunwoong Kim' , 'Prathyush' , 'Grant Grundler' , 'Joerg Roedel' , 'Keyyoung Park' , '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=-5.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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. Signed-off-by: Cho KyongHo Tested-by: Grant Grundler --- 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..e3be3e5 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;