Re: [PATCH v1 11/14] vfio/type1: Register device notifier

2021-03-10 Thread Christoph Hellwig
> + > + if (!dma->pfnmap) { > + struct vfio_device *device; > + unsigned long base_pfn; > + struct pfnmap_obj *pfnmap; Please factor this whole block into a separate helper to keep it readable.

[PATCH v1 11/14] vfio/type1: Register device notifier

2021-03-08 Thread Alex Williamson
Impose a new default strict MMIO mapping mode where the vma for a VM_PFNMAP mapping must be backed by a vfio device. This allows holding a reference to the device and registering a notifier for the device, which additionally keeps the device in an IOMMU context for the extent of the DMA mapping.