[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 03/10] virtio-iommu: Add memory notifiers for map/unmap
From: |
Jean-Philippe Brucker |
Subject: |
Re: [PATCH v10 03/10] virtio-iommu: Add memory notifiers for map/unmap |
Date: |
Thu, 22 Oct 2020 18:41:34 +0200 |
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
- [PATCH v10 00/10] virtio-iommu: VFIO integration, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 01/10] virtio-iommu: Fix virtio_iommu_mr(), Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 04/10] virtio-iommu: Call memory notifiers in attach/detach, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 02/10] virtio-iommu: Store memory region in endpoint struct, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 03/10] virtio-iommu: Add memory notifiers for map/unmap, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 05/10] virtio-iommu: Add replay() memory region callback, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 06/10] virtio-iommu: Add notify_flag_changed() memory region callback, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 07/10] memory: Add interface to set iommu page size mask, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Jean-Philippe Brucker, 2020/10/08