> From: iommu-bounces@xxxxxxxxxxxxxxxxxxxxxxxxxx [mailto:iommu- > bounces@xxxxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jean-Philippe Brucker > Sent: Wednesday, September 26, 2018 9:50 PM > Subject: Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces > > On 26/09/2018 13:45, Joerg Roedel wrote: > > On Wed, Sep 26, 2018 at 11:20:34AM +0100, Jean-Philippe Brucker wrote: > >> Yes, at the moment it's difficult to guess what device drivers will > >> want, but I can imagine some driver offering SVA to userspace, while > >> keeping a few PASIDs for themselves to map kernel memory. Or create mdev > >> devices for virtualization while also allowing bare-metal SVA. So I > >> think we should aim at enabling these use-cases in parallel, even if it > >> doesn't necessarily need to be possible right now. > > > > Yeah okay, but allowing these use-cases in parallel basically disallows > > giving any guest control over a device's pasid-table, no? > All of these use-cases require the host to manage the PASID tables, so > while any one of them is enabled, we can't give a guest control over the > PASID tables. But allowing these use-cases in parallel doesn't change that. > > There is an ambiguity: I understand "(3) SVA in VM guest" as SVA for a > device-assignable interface assigned to a guest, using vfio-mdev and the > new Intel vt-d architecture (right?). That case does require the host to > allocate and manage PASIDs (because the PCI device is shared between > multiple VMs). Correct. For such case, we give host the charge to allocate and manage PASIDs. And the reason is correct. > > For the "classic" vfio-pci case, "SVA in guest" still means giving the > guest control over the whole PASID table. No, if giving guest control over the whole PASID table, it means guest may have its own PASID namespace. right? And for vfio-mdev case, it gets PASID from host. So there would be multiple PASID namespaces. Thinking about the following scenario: A PF/VF assigned to a VM via "classic" vfio-pci. And an assignable-device-interface assigned to this VM via vfio-mdev. If an application in this VM tries to manipulate these two "devices", it should have the same PASID programmed to them. right? But as the above comments mentioned, for vfio-pci case, it would get a PASID from its own PASID namespace. While the vfio-mdev case would get a PASID from host. This would result in conflict. So I would like we get host to allocate and manage the whole PASID table, so that to cover possible combinations of vfio-pci passthru and vfio-mdev passthru. > > Thanks, > Jean Regards, Yi Liu