From patchwork Mon Feb 18 12:52:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varun Sethi X-Patchwork-Id: 221378 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id E1ABB2C1384 for ; Tue, 19 Feb 2013 00:15:51 +1100 (EST) Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe002.messaging.microsoft.com [216.32.180.185]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0E9A82C1CB2 for ; Mon, 18 Feb 2013 23:59:44 +1100 (EST) Received: from mail140-co1-R.bigfish.com (10.243.78.214) by CO1EHSOBE036.bigfish.com (10.243.66.101) with Microsoft SMTP Server id 14.1.225.23; Mon, 18 Feb 2013 12:59:40 +0000 Received: from mail140-co1 (localhost [127.0.0.1]) by mail140-co1-R.bigfish.com (Postfix) with ESMTP id 8E67348016B; Mon, 18 Feb 2013 12:59:40 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1155h) Received: from mail140-co1 (localhost.localdomain [127.0.0.1]) by mail140-co1 (MessageSwitch) id 1361192379542912_32154; Mon, 18 Feb 2013 12:59:39 +0000 (UTC) Received: from CO1EHSMHS007.bigfish.com (unknown [10.243.78.212]) by mail140-co1.bigfish.com (Postfix) with ESMTP id 782B09A06DC; Mon, 18 Feb 2013 12:59:39 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS007.bigfish.com (10.243.66.17) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 18 Feb 2013 12:59:39 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 18 Feb 2013 12:59:38 +0000 Received: from nmglablinux27.zin33.ap.freescale.net (nmglablinux28.zin33.ap.freescale.net [10.232.20.211]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r1ICx8mC031654; Mon, 18 Feb 2013 05:59:35 -0700 From: Varun Sethi To: , , , , , Subject: [PATCH 4/6] iommu/fsl: Add window permission flags for iommu_domain_window_enable API. Date: Mon, 18 Feb 2013 18:22:17 +0530 Message-ID: <1361191939-21260-5-git-send-email-Varun.Sethi@freescale.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1361191939-21260-1-git-send-email-Varun.Sethi@freescale.com> References: <1361191939-21260-1-git-send-email-Varun.Sethi@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: Varun Sethi X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Each iommu window can have access permissions associated with it. Extended the window_enable API to incorporate window access permissions. Signed-off-by: Varun Sethi --- drivers/iommu/iommu.c | 5 +++-- include/linux/iommu.h | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b972d43..1a2564d 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -854,12 +854,13 @@ EXPORT_SYMBOL_GPL(iommu_unmap); int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, - phys_addr_t paddr, u64 size) + phys_addr_t paddr, u64 size, int iommu_prot) { if (unlikely(domain->ops->domain_window_enable == NULL)) return -ENODEV; - return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size); + return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size, + iommu_prot); } EXPORT_SYMBOL_GPL(iommu_domain_window_enable); diff --git a/include/linux/iommu.h b/include/linux/iommu.h index ba3b8a9..529987c 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -105,7 +105,7 @@ struct iommu_ops { /* Window handling functions */ int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, - phys_addr_t paddr, u64 size); + phys_addr_t paddr, u64 size, int iommu_prot); void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); /* Set the numer of window per domain */ int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); @@ -171,7 +171,8 @@ extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, /* Window handling function prototypes */ extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, - phys_addr_t offset, u64 size); + phys_addr_t offset, u64 size, + int iommu_prot); extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); /** * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework @@ -257,7 +258,7 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, static inline int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, phys_addr_t paddr, - u64 size) + u64 size, int iommu_prot) { return -ENODEV; }