>-----Original Message-----
>From: Steven Sistare <steven.sist...@oracle.com>
>Subject: Re: [PATCH V3 31/42] vfio/iommufd: use IOMMU_IOAS_MAP_FILE
>
>On 5/19/2025 11:52 AM, Steven Sistare wrote:
>> On 5/16/2025 4:48 AM, Duan, Zhenzhong wrote:
>>>> -----Original Message-----
>>>> From: Steve Sistare <steven.sist...@oracle.com>
>>>> Subject: [PATCH V3 31/42] vfio/iommufd: use IOMMU_IOAS_MAP_FILE
>>>>
>>>> Use IOMMU_IOAS_MAP_FILE when the mapped region is backed by a file.
>>>> Such a mapping can be preserved without modification during CPR,
>>>> because it depends on the file's address space, which does not change,
>>>> rather than on the process's address space, which does change.
>>>>
>>>> Signed-off-by: Steve Sistare <steven.sist...@oracle.com>
>>>> ---
>>>> hw/vfio/container-base.c | 9 +++++++++
>>>> hw/vfio/iommufd.c | 13 +++++++++++++
>>>> include/hw/vfio/vfio-container-base.h | 3 +++
>>>> 3 files changed, 25 insertions(+)
>>>>
>>>> diff --git a/hw/vfio/container-base.c b/hw/vfio/container-base.c
>>>> index 8f43bc8..72a51a6 100644
>>>> --- a/hw/vfio/container-base.c
>>>> +++ b/hw/vfio/container-base.c
>>>> @@ -79,7 +79,16 @@ int vfio_container_dma_map(VFIOContainerBase
>>>> *bcontainer,
>>>> RAMBlock *rb)
>>>> {
>>>> VFIOIOMMUClass *vioc = VFIO_IOMMU_GET_CLASS(bcontainer);
>>>> + int mfd = rb ? qemu_ram_get_fd(rb) : -1;
>>>>
>>>> + if (mfd >= 0 && vioc->dma_map_file) {
>>>> + unsigned long start = vaddr - qemu_ram_get_host_addr(rb);
>>>> + unsigned long offset = qemu_ram_get_fd_offset(rb);
>>>> +
>>>> + vioc->dma_map_file(bcontainer, iova, size, mfd, start + offset,
>>>> + readonly);
>>>
>>> Shouldn't we return result to call site?
>>
>> Yes! Good catch, thanks.
>
>With that simple fix:
> return vioc->dma_map_file(...)
>can I add your RB?
Yes,
Reviewed-by: Zhenzhong Duan <zhenzhong.d...@intel.com>
Thanks
Zhenzhong