Re: [RFC 05/12] kvm/vfio: Accept vfio device file from userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023/1/6 22:32, Jason Gunthorpe wrote:
On Mon, Dec 19, 2022 at 12:47:11AM -0800, Yi Liu wrote:
This defines KVM_DEV_VFIO_FILE* and make alias with KVM_DEV_VFIO_GROUP*.
Old userspace uses KVM_DEV_VFIO_GROUP* works as well.

Do we have a circular refcount problem with this plan?

The kvm will hold a ref on the vfio device struct file

Once the vfio device struct file reaches open_device we will hold a
ref on the kvm

At this point if both kvm and vfio device FDs are closed will the
kernel clean it up or does it leak because they both ref each other?

looks to be a circular. In my past test, seems no apparent issue. But
I'll do a test to confirm it. If this is a problem, it should be an
existing issue. right? Should have same issue with group file.

Please test to confirm..

will do.

--
Regards,
Yi Liu



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux