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: 2833988 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EFF5CC0319 for ; Fri, 26 Jul 2013 11:26:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C9CA2012D for ; Fri, 26 Jul 2013 11:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C31F20172 for ; Fri, 26 Jul 2013 11:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758651Ab3GZL0c (ORCPT ); Fri, 26 Jul 2013 07:26:32 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:50846 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758543Ab3GZL03 (ORCPT ); Fri, 26 Jul 2013 07:26:29 -0400 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>; Fri, 26 Jul 2013 20:26:29 +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' Cc: 'Hyunwoong Kim' , 'Joerg Roedel' , 'Kukjin Kim' , 'Prathyush' , 'Rahul Sharma' , 'Subash Patel' , 'Keyyoung Park' , 'Grant Grundler' , 'Antonios Motakis' , kvmarm@lists.cs.columbia.edu, 'Sachin Kamat' 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 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit 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/X4ElhAUSJGYfXcQMYrMIqEosPzSBBcTmFbCUeLGoF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Vk1CwkLQsYWVYxiqYWJBcUJ6XnGukVJ+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 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=-8.4 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. 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;