From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Thu, 15 Feb 2018 11:21:13 +0100 From: "joro@8bytes.org" To: Jean-Philippe Brucker Subject: Re: [PATCH 02/37] iommu/sva: Bind process address spaces to devices Message-ID: <20180215102113.c7t7rrnyzgazmdli@8bytes.org> References: <20180212183352.22730-1-jean-philippe.brucker@arm.com> <20180212183352.22730-3-jean-philippe.brucker@arm.com> MIME-Version: 1.0 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "xieyisheng1@huawei.com" , "ilias.apalodimas@linaro.org" , mykyta.iziumtsev@linaro.org, "kvm@vger.kernel.org" , "linux-pci@vger.kernel.org" , "xuzaibo@huawei.com" , "jonathan.cameron@huawei.com" , Will Deacon , "okaya@codeaurora.org" , "Liu, Yi L" , Lorenzo Pieralisi , "Raj, Ashok" , "tn@semihalf.com" , "robdclark@gmail.com" , "bharatku@xilinx.com" , "linux-acpi@vger.kernel.org" , Catalin Marinas , "rfranz@cavium.com" , "lenb@kernel.org" , "devicetree@vger.kernel.org" , "Tian, Kevin" , "jacob.jun.pan@linux.intel.com" , "alex.williamson@redhat.com" , "robh+dt@kernel.org" , "thunder.leizhen@huawei.com" , "bhelgaas@google.com" , "linux-arm-kernel@lists.infradead.org" , "shunyong.yang@hxt-semitech.com" , "dwmw2@infradead.org" , "liubo95@huawei.com" , "rjw@rjwysocki.net" , "jcrouse@codeaurora.org" , "iommu@lists.linux-foundation.org" , "hanjun.guo@linaro.org" , Sudeep Holla , Robin Murphy , "christian.koenig@amd.com" , "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 Tue, Feb 13, 2018 at 12:57:23PM +0000, Jean-Philippe Brucker wrote: > * bind_device() fails if the device's group has more than one device, > otherwise calls __bind_device(). This prevents device drivers that are > oblivious to IOMMU groups from opening a backdoor. > > * bind_group() calls __bind_device() for all devices in group. This way > users that are aware of IOMMU groups can still use them safely. Note that > at the moment bind_group() fails as soon as it finds a device that doesn't > support SVA. Having all devices support SVA in a given group is > unrealistic and this behavior ought to be improved. Yeah, so the problem on PCI is that all functions of a multi-function device are put into one group. For AMD-GPUs this means that the GPU (SVA-capable) will end up in the same group as the on-GPU sound device (not SVA-capable). Before this causes us big headaches I suggest to only provide the bind_device() function. This should be fine because for SVA we don't need all types of isolation that iommu_groups provide. IOMMU-groups provide two types of isolation: 1) They group devices together which the IOMMU can't distinguish from each other, like PCI devices behind a PCIe bridge. 2) Devices that can't be isolated from each other are also put into the same group. This is the case for multi-function PCIe devices as well as all PCIe devices behind a non-ACS bridge. But all these devices cann still be distinguished by the IOMMU. These two types of protection are needed to safely assign devices to guests, but for bare-metal SVA all we need is type 1) isolation, and not even that if we can assume that all SVA-capable devices have an exclusive device-id (or stream-id). Joerg _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel