From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhenyu Wang Subject: Re: [PATCH v2] drm/i915/gvt: Change KVMGT as self load module Date: Mon, 3 Dec 2018 11:38:51 +0800 Message-ID: <20181203033851.GL12743@zhen-hp.sh.intel.com> References: <20181130060838.4528-3-zhenyuw@linux.intel.com> <20181130065124.4325-1-zhenyuw@linux.intel.com> <20181130084423.355805b8@x1.home> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1322453441==" Return-path: In-Reply-To: <20181130084423.355805b8@x1.home> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Alex Williamson Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1322453441== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rMHhSL690X5+a0Qo" Content-Disposition: inline --rMHhSL690X5+a0Qo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018.11.30 08:44:23 -0700, Alex Williamson wrote: > On Fri, 30 Nov 2018 14:51:24 +0800 > Zhenyu Wang wrote: >=20 > > 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/md= ev. > >=20 > > 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. >=20 > 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, >=20 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 man= ner. Thanks --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --rMHhSL690X5+a0Qo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCXASlSwAKCRCxBBozTXgY J85VAKCX8TXrlcA0sTPykRJ2o4AGlj66VACfVpMiEdRjhpKMoLX6hke4Yd0oEpU= =FWmo -----END PGP SIGNATURE----- --rMHhSL690X5+a0Qo-- --===============1322453441== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1322453441==--