>-----Original Message-----
>From: Cédric Le Goater <c...@redhat.com>
>Subject: Re: [PATCH] vfio: Remove workaround for kernel DMA unmap
>overflow bug
>
>+ Zhenzhong
>
>On 9/26/25 10:54, Cédric Le Goater wrote:
>> A kernel bug was introduced in Linux v4.15 via commit 71a7d3d78e3c
>> ("vfio/type1: Check for address space wrap-around on unmap"), which
>> added a test for address space wrap-around in the vfio DMA unmap path.
>> Unfortunately, due to an integer overflow, the kernel would
>> incorrectly detect an unmap of the last page in the 64-bit address
>> space as a wrap-around, causing the unmap to fail with -EINVAL.
>>
>> A QEMU workaround was introduced in commit 567d7d3e6be5
>("vfio/common:
>> Work around kernel overflow bug in DMA unmap") to retry the unmap,
>> excluding the final page of the range.
>>
>> The kernel bug was then fixed in Linux v5.0 via commit 58fec830fc19
>> ("vfio/type1: Fix dma_unmap wrap-around check"). Since the oldest
>> supported LTS kernel is now v5.4, kernels affected by this bug are
>> considered deprecated, and the workaround is no longer necessary.
>>
>> This change reverts 567d7d3e6be5, removing the workaround.
>>
>> Link: https://bugzilla.redhat.com/show_bug.cgi?id=1662291
>> Signed-off-by: Cédric Le Goater <c...@redhat.com>

Reviewed-by: Zhenzhong Duan <zhenzhong.d...@intel.com>

Thanks
Zhenzhong

Reply via email to