On 2018.11.30 08:44:23 -0700, Alex Williamson wrote: > On Fri, 30 Nov 2018 14:51:24 +0800 > Zhenyu Wang <zhenyuw@xxxxxxxxxxxxxxx> wrote: > > > This trys to make 'kvmgt' module as self loadable instead of loading > > by i915/gvt device model. So hypervisor specific module could be > > stand-alone, e.g only after loading hypervisor specific module, GVT > > feature could be enabled via specific hypervisor interface, e.g VFIO/mdev. > > > > So this trys to use hypervisor module register/unregister interface > > for that. Hypervisor module needs to take care of module reference > > itself when working for hypervisor interface, e.g reference counting > > for any VFIO/mdev creation. > > This doesn't sound right and I don't see that it's how it works today. > mdev core doesn't take a reference to the vendor driver, it's the > vendor driver's responsibility to take a module reference when a device > is opened. Likewise created, but unused devices probably shouldn't > hold a reference, they should be cleaned up on module release > callback. Thanks, > In this patch kvmgt driver trys to take module reference when device created and put when destroy, and yeah I think your point is right, we'd better handle reference when device is opened or released, and when hypervisor module releases it would call mdev core device unregister which has already handled unused devices clean up. Will refresh in that manner. Thanks -- Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx