Re: [PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Auger Eric
Hi Peter, On 2/18/21 6:48 PM, Peter Xu wrote: > On Thu, Feb 18, 2021 at 06:18:22PM +0100, Auger Eric wrote: >> Hi Peter, >> >> On 2/18/21 5:42 PM, Peter Xu wrote: >>> Eric, >>> >>> On Thu, Feb 18, 2021 at 03:16:50PM +0100, Eric Auger wrote: @@ -164,12 +166,27 @@ static void virtio_iommu

Re: [PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Peter Xu
On Thu, Feb 18, 2021 at 06:18:22PM +0100, Auger Eric wrote: > Hi Peter, > > On 2/18/21 5:42 PM, Peter Xu wrote: > > Eric, > > > > On Thu, Feb 18, 2021 at 03:16:50PM +0100, Eric Auger wrote: > >> @@ -164,12 +166,27 @@ static void > >> virtio_iommu_notify_unmap(IOMMUMemoryRegion *mr, hwaddr virt_s

Re: [PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Auger Eric
Hi Peter, On 2/18/21 5:42 PM, Peter Xu wrote: > Eric, > > On Thu, Feb 18, 2021 at 03:16:50PM +0100, Eric Auger wrote: >> @@ -164,12 +166,27 @@ static void >> virtio_iommu_notify_unmap(IOMMUMemoryRegion *mr, hwaddr virt_start, >> >> event.type = IOMMU_NOTIFIER_UNMAP; >> event.entry.ta

Re: [PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Peter Xu
Eric, On Thu, Feb 18, 2021 at 03:16:50PM +0100, Eric Auger wrote: > @@ -164,12 +166,27 @@ static void virtio_iommu_notify_unmap(IOMMUMemoryRegion > *mr, hwaddr virt_start, > > event.type = IOMMU_NOTIFIER_UNMAP; > event.entry.target_as = &address_space_memory; > -event.entry.addr_m

[PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Eric Auger
Unmap notifiers work with an address mask assuming an invalidation range of a power of 2. Nothing mandates this in the VIRTIO-IOMMU spec. So in case the range is not a power of 2, split it into several invalidations. Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 23 ++