Skip to content

Commit f3bb8b5

Browse files
committed
iommu/vfio: reset iova reserve context when close
If we don't reset the iova reserve context properly in vfio_put_device_fio(), iova will incremently be growing even if application closed the vfio fd and re-open it again. To start from the beginning, reset the context properly when closing the file. Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
1 parent f922041 commit f3bb8b5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/iommu/vfio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ static int vfio_put_device_fd(struct iommu_ctx *ctx, const char *bdf)
618618

619619
vfio->fd = -1;
620620
vfio->iommu_set = false;
621+
vfio->next = 0;
622+
vfio->next_ephemeral = 0;
623+
vfio->nephemerals = 0;
621624
}
622625
}
623626

0 commit comments

Comments
 (0)