[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap |
Date: |
Fri, 30 Oct 2020 19:19:14 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 30/10/20 18:26, Alex Williamson wrote:
>>
>> if (try_unmap) {
>> + if (llsize == int128_2_64()) {
>> + /* The unmap ioctl doesn't accept a full 64-bit span. */
>> + llsize = int128_rshift(llsize, 1);
>> + ret = vfio_dma_unmap(container, iova, int128_get64(llsize));
>> + if (ret) {
>> + error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "
>> + "0x%"HWADDR_PRIx") = %d (%m)",
>> + container, iova, int128_get64(llsize), ret);
>> + }
>> + iova += int128_get64(llsize);
>> + }
>> ret = vfio_dma_unmap(container, iova, int128_get64(llsize));
>> if (ret) {
>> error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "
> We're still susceptible that splitting the range in two could result in
> unmap calls that attempt to bisect a mapping that spans both ranges.
> Both unmap calls would fail in that case. I think we could solve this
> more completely with a high water marker, but this probably good enough
> for now.
>
> Acked-by: Alex Williamson <alex.williamson@redhat.com>
Could it also be fixed by passing an Int128 to vfio_dma_unmap?
Paolo
Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap, Auger Eric, 2020/10/16
Re: [PATCH v10 00/10] virtio-iommu: VFIO integration, Auger Eric, 2020/10/16
Re: [PATCH v10 00/10] virtio-iommu: VFIO integration, Michael S. Tsirkin, 2020/10/30