From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Philippe Brucker Subject: Re: [RFCv2 PATCH 31/36] iommu/arm-smmu-v3: Add support for PCI ATS Date: Fri, 17 Nov 2017 11:39:25 +0000 Message-ID: <9da446e9-cf84-61ce-f3f5-32386387bc9f@arm.com> References: <20171006133203.22803-1-jean-philippe.brucker@arm.com> <20171006133203.22803-32-jean-philippe.brucker@arm.com> <673fda01-2ae0-87e4-637e-fe27096b6be0@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Bharat Kumar Gogada , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" Cc: Mark Rutland , "gabriele.paoloni-hv44wF8Li93QT0dZR+AlfA@public.gmane.org" , Catalin Marinas , Will Deacon , "okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org" , "rfranz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org" , "lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org" , "dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org" , "rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org" , Sudeep Holla List-Id: linux-acpi@vger.kernel.org On 17/11/17 06:11, Bharat Kumar Gogada wrote: [...] > Thanks Jean, I see that currently vfio_group_fops_open does not allow multiple instances. > If a device supports multiple PASID there might be different applications running parallel. > So why is multiple instances restricted ? You can't have multiple processes owning the same PCI device, it's unmanageable. For using multiple PASIDs, my idea was that the userspace driver ("the server"), that owns the device, would have a way to partition it into smaller frames. It forks to create "clients" and assigns a PASID to each of them (by issuing VFIO_BIND(client_pid) -> pasid, then writing the PASID into a privileged MMIO frame that defines the partition properties). Each client accesses an unprivileged MMIO frame to use a device partition (or sends commands to the server via IPC), and can perform DMA on its own virtual memory. This is complete speculation of course, we have very little information on how PASID-capable devices will be designed, so I'm trying to imagine likely scenarios. Thanks, Jean From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Subject: Re: [RFCv2 PATCH 31/36] iommu/arm-smmu-v3: Add support for PCI ATS To: Bharat Kumar Gogada , "linux-arm-kernel@lists.infradead.org" , "linux-pci@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "devicetree@vger.kernel.org" , "iommu@lists.linux-foundation.org" References: <20171006133203.22803-1-jean-philippe.brucker@arm.com> <20171006133203.22803-32-jean-philippe.brucker@arm.com> <673fda01-2ae0-87e4-637e-fe27096b6be0@arm.com> From: Jean-Philippe Brucker Message-ID: <9da446e9-cf84-61ce-f3f5-32386387bc9f@arm.com> Date: Fri, 17 Nov 2017 11:39:25 +0000 MIME-Version: 1.0 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "xieyisheng1@huawei.com" , "gabriele.paoloni@huawei.com" , Catalin Marinas , Will Deacon , "okaya@codeaurora.org" , "yi.l.liu@intel.com" , Lorenzo Pieralisi , "ashok.raj@intel.com" , "tn@semihalf.com" , "joro@8bytes.org" , "rfranz@cavium.com" , "lenb@kernel.org" , "jacob.jun.pan@linux.intel.com" , "alex.williamson@redhat.com" , "robh+dt@kernel.org" , "thunder.leizhen@huawei.com" , "bhelgaas@google.com" , "dwmw2@infradead.org" , "liubo95@huawei.com" , "rjw@rjwysocki.net" , "robdclark@gmail.com" , "hanjun.guo@linaro.org" , Sudeep Holla , Robin Murphy , "nwatters@codeaurora.org" Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: On 17/11/17 06:11, Bharat Kumar Gogada wrote: [...] > Thanks Jean, I see that currently vfio_group_fops_open does not allow multiple instances. > If a device supports multiple PASID there might be different applications running parallel. > So why is multiple instances restricted ? You can't have multiple processes owning the same PCI device, it's unmanageable. For using multiple PASIDs, my idea was that the userspace driver ("the server"), that owns the device, would have a way to partition it into smaller frames. It forks to create "clients" and assigns a PASID to each of them (by issuing VFIO_BIND(client_pid) -> pasid, then writing the PASID into a privileged MMIO frame that defines the partition properties). Each client accesses an unprivileged MMIO frame to use a device partition (or sends commands to the server via IPC), and can perform DMA on its own virtual memory. This is complete speculation of course, we have very little information on how PASID-capable devices will be designed, so I'm trying to imagine likely scenarios. Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: jean-philippe.brucker@arm.com (Jean-Philippe Brucker) Date: Fri, 17 Nov 2017 11:39:25 +0000 Subject: [RFCv2 PATCH 31/36] iommu/arm-smmu-v3: Add support for PCI ATS In-Reply-To: References: <20171006133203.22803-1-jean-philippe.brucker@arm.com> <20171006133203.22803-32-jean-philippe.brucker@arm.com> <673fda01-2ae0-87e4-637e-fe27096b6be0@arm.com> Message-ID: <9da446e9-cf84-61ce-f3f5-32386387bc9f@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 17/11/17 06:11, Bharat Kumar Gogada wrote: [...] > Thanks Jean, I see that currently vfio_group_fops_open does not allow multiple instances. > If a device supports multiple PASID there might be different applications running parallel. > So why is multiple instances restricted ? You can't have multiple processes owning the same PCI device, it's unmanageable. For using multiple PASIDs, my idea was that the userspace driver ("the server"), that owns the device, would have a way to partition it into smaller frames. It forks to create "clients" and assigns a PASID to each of them (by issuing VFIO_BIND(client_pid) -> pasid, then writing the PASID into a privileged MMIO frame that defines the partition properties). Each client accesses an unprivileged MMIO frame to use a device partition (or sends commands to the server via IPC), and can perform DMA on its own virtual memory. This is complete speculation of course, we have very little information on how PASID-capable devices will be designed, so I'm trying to imagine likely scenarios. Thanks, Jean