From patchwork Wed May 3 15:48:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 9710023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D9B360385 for ; Wed, 3 May 2017 15:51:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C15E2862C for ; Wed, 3 May 2017 15:51:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00B3828668; Wed, 3 May 2017 15:51:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7BCF728665 for ; Wed, 3 May 2017 15:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wi7ZUR2hF78lh5/P+JrVBji1Qd5nk7nn7d5/PiGeEtc=; b=B/zUKFJoeFtB4+ /wNDnsQe972SE8yQtfBDRGlgeoXllOGWEx7QhFwSS0nN1dBT5yxpQuyhQW9xV0BICVMgkE5t+fHiq TdOAlxHmrKTaBNQ0wE2/X6sJ/OuN9kgQP6mJV6O5LPW0GdR31uhcdUbuDPvIdWtSKuTjOb/x5/gE4 6HG+B34kZWoKo34AoEEwgOciLiefU4nuct1gwekza69wj48BfF44k5196a/5YasTVl2uHLdQ41P5M 2mBolSQwK+hyorPCCBjlaAzLgQnz0t/F9GVSbCKmHBR7is2eQjZnJTQ+ogO7FCx+v4gcgEmuuoYGv gIo7qECb197sRACCbakg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d5wYx-0001ry-RB; Wed, 03 May 2017 15:51:35 +0000 Received: from mail-bl2nam02on0068.outbound.protection.outlook.com ([104.47.38.68] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5wYu-0001qn-Ny for linux-arm-kernel@lists.infradead.org; Wed, 03 May 2017 15:51:34 +0000 Received: from BN6PR03CA0069.namprd03.prod.outlook.com (10.173.137.31) by BL2PR03MB162.namprd03.prod.outlook.com (10.255.230.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Wed, 3 May 2017 15:51:08 +0000 Received: from BY2FFO11FD042.protection.gbl (2a01:111:f400:7c0c::113) by BN6PR03CA0069.outlook.office365.com (2603:10b6:404:4c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Wed, 3 May 2017 15:51:08 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD042.mail.protection.outlook.com (10.1.14.227) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1047.9 via Frontend Transport; Wed, 3 May 2017 15:51:07 +0000 Received: from localhost.localdomain.ap.freescale.net ([10.232.14.21]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v43Fp37w018768; Wed, 3 May 2017 08:51:04 -0700 From: Bharat Bhushan To: , Subject: [PATCH] ARM64/PCI: Allow userspace to mmap PCI resources Date: Wed, 3 May 2017 21:18:58 +0530 Message-ID: <1493826538-23785-1-git-send-email-Bharat.Bhushan@nxp.com> X-Mailer: git-send-email 1.9.3 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131383002680754421; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39860400002)(39400400002)(39380400002)(39850400002)(39410400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(105606002)(5003940100001)(53936002)(50986999)(77096006)(498600001)(54906002)(104016004)(81156014)(356003)(8936002)(50226002)(8676002)(47776003)(81166006)(50466002)(48376002)(8656002)(36756003)(106466001)(86362001)(2906002)(38730400002)(189998001)(85426001)(5660300001)(6666003)(4326008)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB162; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD042; 1:HpPPDr8zknFq/Bx6g6b79+kOp1XTkd9hY7QIiScHVC41nnfUGN2/aEao2wACfF0M4DFnmnMgJR8viY7ApsMI9R1myzgFcnsvs87whWPcBwx1MXELl4rJEv5+OtNzpqBP5y62Z2h1wUOBpOud/YJcfhof9ZBEvelR9CoduZG2AUySAY+Lrsv1vaKRo+spm4gJfmDIWeZSPenFeL4qNouPJBlCQhX2+c8N4BMLqTf0xIOlroHOGXshpdm7Ym8r/0ofkQlviY6CPuZbrEaWtoVnA5rq2g8KPcdEAiWdkIt0rGFesEdFadLoNqrKNmWfuGtqBuqhL1iE+fePAuzVGno+/swCjsRH9DBfqiVIR7mrGkgSya4reAvKvlyB2ZpkJvcbCvxrFaEPg3rkSw/GaS5jYYTsMVLYa+Ogd3K/7s1SqFMABxsAfpVayg0YvKVBbj0Vd8i1TGXw7gTmdPFwYCvHbQeRnlZclgLApyJHzhYlApCETeaZQRd6tHHl2E2OaKPun4F0/YU9hVCG0CN3UatBg7BFKzVFWYu1FAoSz/MTopQSmogZCoejnkQnQF2k4BTAuNnhjiexD4r+UjB7M1ZX9rheokPN5g9qBT4RfvvPBgthmxhfriNB/PvqWvTUO9ygu8nc4/Nq37zo53eR6saFzh2kZxIQk901a1eHgey+F59Rmvb5ABZ8rpdJhK5PeF1yi0gYBRJkND5SrKD/aWMXgp6QwGLGm2/yJ3Xn+zl3qoGW62Qz+suE49QZ410UaPQP MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de4bbe80-cc66-4ace-148c-08d4923c36b1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BL2PR03MB162; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB162; 3:Shk5FaHFjfMSveAtx17y//zDzwAeRpX840rgw9rnllke3vw9P+E7/LKhtj0ZhamYOf5ePtwe7DenY7TQ4CYzWqP9vSC7FkMJhwRyU3M1rTu8XkN1iz9l3gS+Avsc2JQ7j6UnQG13U2Bm4hbTYcwhkTfuMlZ+z95gC1UiUXSVP2Ih+F/bop4G3/NWy1sza5uAPYq9Lxh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: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(8121501046)(13015025)(5005006)(13024025)(13018025)(13023025)(13017025)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123556025)(20161123563025)(20161123565025); SRVR:BL2PR03MB162; BCL:0; PCL:0; RULEID:(400006); SRVR:BL2PR03MB162; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB162; 4:ksegXeltMToSaaK55tof0Zd6r4xPeoaeiIZmisL0b96?= =?us-ascii?Q?6QphZsxYwlzFZN1wq4qs5XSfciC4xkqiL70P5ThjNYJ08JbX8aba09Gw0RKg?= =?us-ascii?Q?4+rBbSF2nCJMZcRI/DMvAa0wmtQLfANpoimardQ5XbwbWTl4tvYKgM4msmEt?= =?us-ascii?Q?0hqi+hcNUFY0B/WKC47BVC3rVBmNPfYRauPpgVDnmjTEbk2sYS+i3ULxPcsZ?= =?us-ascii?Q?X6xUYT/yZ12KpT9ZnvE3wxKkOrRpK90KQ7AwSsrmKH6JBWz9lDuAiPbgJmQW?= =?us-ascii?Q?WXIBt8rsH2c2pDfHFeMEVysWNJWxleMxvEkixYJu8PC8Ayrz1uUDUcyr9ori?= =?us-ascii?Q?stf4SH9lmDpmyY9TUjiTBN6tsspqyLdHx1FVgYGnjoSKoXihsZPUYuvPqhkJ?= =?us-ascii?Q?lSAPTtaof++NvjFHHccqoZb54bpmm94opcUEM6GdzSq4krSAl8v7ZKTSu9pT?= =?us-ascii?Q?XiARSRtXZOe1jEXMGIhWjqrbjNz8l/7VX233Nfy8XoXyIhh6ZAEh/gKJ5cPw?= =?us-ascii?Q?XUwpCLopl0Z1zBbfIX8sJ74X7S8/FtJNiZhdIlEuU+Y3H3+nhIpMjBp23CKX?= =?us-ascii?Q?6ZytwA99AcvP6KuD8VqnieCkx45mRVe7I5lK1QnoaGAz+CzwwFEaUfflTLON?= =?us-ascii?Q?tfiP/VA/f4rxe0V3w+axgOHaF9PbIOCsNzj/5hRlebqCvH7aQSCyhqEXRGP+?= =?us-ascii?Q?CiOLKMMmUIInOgSOT2osbzAhEHYJ47Q+VdyvEYfy0TCw9dUxD1A1SQtpbpXo?= =?us-ascii?Q?jFT86xO5WYuw8tcgcSnFA1VKwQYKdN4RH5p3oaRmoPV6olgtpwZzJBFaofX1?= =?us-ascii?Q?P3JMl68YEJCOYZv+XD/adFvDtqItnzMEfSq6FS5BWC98nPiQIq6LXGzK5+G7?= =?us-ascii?Q?T+mISWNza1mVtXOp+ueOrs3GrUAz/Aqw9uspPsVK/GpEK/oomqb9dKW07Dxd?= =?us-ascii?Q?GmTJXyoGLqUWChyqBsYZEfkO186OF4g5f21kR7Q=3D=3D?= X-Forefront-PRVS: 029651C7A1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB162; 23:8dbCmmiW0UIg+OCDe4J11gJdyVSSsMaewQrHoXuqN7?= =?us-ascii?Q?2UXJbcZWwl8nEhXt4cQekJ4aouUdib/HCq2u+qDGd/fe+6fTp5vp3pNInZIJ?= =?us-ascii?Q?o/rRZgzr90sh8mXsisqtg/bZadb+oUNbnqfHtPmP5RhAJGYWBdaOFGLlB0d8?= =?us-ascii?Q?WvBrNF3/Jcyy4ScHMOxLVhjwc3XNt/qjqlIjFYEBT72EgrdRtnAyRz+E4rQt?= =?us-ascii?Q?+cGQ63BtNj9dtfAeUffRwVMWoNBzeWcoX5u6fRTnbEd1Dr4C5E169xqciXfx?= =?us-ascii?Q?2WyfgPCXlLgJeKHkLziHHGVUw7Xacpc+zilIxt2H3mRUsbh/feSnUrGBpwik?= =?us-ascii?Q?AFWTceE3szkOhkt2jKJ3igHSNUycpYSAaDe9w227NjMYqqyKzR2BPKfXi7Mt?= =?us-ascii?Q?UQcaQ+u2YwvZgSFz6NO4iOwnsFAdPwJwmurW97Unp8tzoQFXqou+Y06c7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WXvSSy1gd+uDVjvBJA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 15:51:07.7478 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB162 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170503_085132_928976_0E9FD9D2 X-CRM114-Status: GOOD ( 13.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bhelgaas@google.com, Bharat Bhushan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch allows user-space to mmap PCI resources. This patch is inline to arm32 bit implementation. Signed-off-by: Bharat Bhushan --- arch/arm64/include/asm/pci.h | 4 ++++ arch/arm64/kernel/pci.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h index b9a7ba9..8a18915 100644 --- a/arch/arm64/include/asm/pci.h +++ b/arch/arm64/include/asm/pci.h @@ -31,6 +31,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) return -ENODEV; } +#define HAVE_PCI_MMAP +extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state, + int write_combine); static inline int pci_proc_domain(struct pci_bus *bus) { return 1; diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index ce20f4c..2e45a83 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -97,6 +97,25 @@ int pcibios_check_service_irqs(struct pci_dev *dev, int *irqs, int mask) return count; } +int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state, int write_combine) +{ + if (mmap_state == pci_mmap_io) + return -EINVAL; + + /* + * Mark this as IO + */ + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + + if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, + vma->vm_end - vma->vm_start, + vma->vm_page_prot)) + return -EAGAIN; + + return 0; +} + /* * raw_pci_read/write - Platform-specific PCI config space access. */