On Fri, Oct 16, 2020 at 09:58:28AM +0200, Auger Eric wrote:
> > +static void virtio_iommu_notify_map(IOMMUMemoryRegion *mr, hwaddr
> > virt_start,
> > + hwaddr virt_end, hwaddr paddr)
> > +{
> > + IOMMUTLBEntry entry;
> > + IOMMUNotifierFlag flags = mr->iommu_notify_flags;
> > +
> > + if (!(flags & IOMMU_NOTIFIER_MAP)) {
> > + return;
> > + }
> > +
> > + trace_virtio_iommu_notify_map(mr->parent_obj.name, virt_start,
> > virt_end,
> > + paddr);
> > +
> > + entry.target_as = &address_space_memory;
> > + entry.addr_mask = virt_end - virt_start;
> > + entry.iova = virt_start;
> > + entry.perm = IOMMU_RW;
> logically you should be able to cascade the struct virtio_iommu_req_map
> *req flags field instead.
Agreed.
I'm also thinking of adding a check for VIRTIO_IOMMU_MAP_F_MMIO, to avoid
going further into the notifier and maybe do the same for unmap.
Thanks,
Jean