On Mon, Oct 22, 2018 at 12:49:47PM +0800, Lu Baolu wrote: > Hi, > > On 10/20/18 2:11 AM, Jean-Philippe Brucker wrote: > > Some devices might support multiple DMA address spaces, in particular > > those that have the PCI PASID feature. PASID (Process Address Space ID) > > allows to share process address spaces with devices (SVA), partition a > > device into VM-assignable entities (VFIO mdev) or simply provide > > multiple DMA address space to kernel drivers. Add a global PASID > > allocator usable by different drivers at the same time. Name it I/O ASID > > to avoid confusion with ASIDs allocated by arch code, which are usually > > a separate ID space. > > > > The IOASID space is global. Each device can have its own PASID space, > > but by convention the IOMMU ended up having a global PASID space, so > > that with SVA, each mm_struct is associated to a single PASID. > > > > The allocator doesn't really belong in drivers/iommu because some > > drivers would like to allocate PASIDs for devices that aren't managed by > > an IOMMU, using the same ID space as IOMMU. It doesn't really belong in > > drivers/pci either since platform device also support PASID. Add the > > allocator in drivers/base. > > One concern of moving pasid allocator here is about paravirtual > allocation of pasid. > > Since there is only a single set of pasid tables which is controlled by
Minor correction: Single system wide PASID namespace, but PASID tables would be created ideally per-bdf for isolation purposes. I'm sure you meant name space, but didn't want that to be mis-interpreted. > the host, the pasid is a system wide resource. When a driver running in > a guest VM wants to consume a pasid, it must be intercepted by the > simulation software and routed the allocation to the host via VFIO. Some > iommu arch's provide mechanisms to aid this, for example, the virtual > command interfaces defined in vt-d 3.0. Any pasid used in guest VM > should go through the virtual command interfaces. > Cheers, Ashok _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu