From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhenyu Wang Subject: Re: [libvirt] [PATCH v2 1/1] Add attribute single_usage_restriction for mdev type-id Date: Thu, 11 Oct 2018 09:14:22 +0800 Message-ID: <20181011011422.GA21296@zhen-hp.sh.intel.com> References: <1539029417-19371-1-git-send-email-kwankhede@nvidia.com> <20181010143847.61c221d3@w520.home> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5914844945179166369==" Cc: "cjia@nvidia.com" , "kvm@vger.kernel.org" , "eskultet@redhat.com" , "libvir-list@redhat.com" , Kirti Wankhede , "intel-gvt-dev@lists.freedesktop.org" To: "Tian, Kevin" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com List-Id: kvm.vger.kernel.org --===============5914844945179166369== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018.10.10 23:22:20 +0000, Tian, Kevin wrote: > > From: Alex Williamson > > Sent: Thursday, October 11, 2018 4:39 AM > >=20 > > On Tue, 9 Oct 2018 01:40:17 +0530 > > Kirti Wankhede wrote: > >=20 > > > Generally a single instance of mdev device, a share of physical devic= e, is > > > assigned to user space application or a VM. There are cases when > > multiple > > > instances of mdev devices of same or different types are required by = user > > > space application or VM. For example in case of vGPU, multiple mdev > > devices > > > of type which represents whole GPU can be assigned to one instance of > > > application or VM. > > > > > > All types of mdev devices may not support assigning multiple mdev > > devices > > > to a user space application. In that case vendor driver can fail open= () > > > call of mdev device. But there is no way to know User space applicati= on to > > > about the configuration supported by vendor driver. > > > > > > To expose supported configuration, vendor driver should add > > > 'single_usage_restriction' attribute to type-id directory. Returning = Y for > > > this attribute indicates vendor driver has restriction of single mdev > > > device of particular assigned to one user space application. > > > Returning N indicates that multiple mdev devices of particular > > > can be assigned to one user space application. > > > > > > User space application should read if 'single_usage_restriction' atti= bute > > > is present in directory of all mdev devices which are going= to be > > > used. If all read N then user space application can proceed with mult= iple > > > mdev devices. > > > > > > This is optional and readonly attribute. > > > > > > Signed-off-by: Kirti Wankhede > > > Reviewed-by: Neo Jia > > > --- > > > Documentation/ABI/testing/sysfs-bus-vfio-mdev | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > > > > diff --git a/Documentation/ABI/testing/sysfs-bus-vfio-mdev > > b/Documentation/ABI/testing/sysfs-bus-vfio-mdev > > > index 452dbe39270e..3aca352a70e5 100644 > > > --- a/Documentation/ABI/testing/sysfs-bus-vfio-mdev > > > +++ b/Documentation/ABI/testing/sysfs-bus-vfio-mdev > > > @@ -85,6 +85,22 @@ Users: > > > a particular that can help in understanding the > > > features provided by that type of mediated device. > > > > > > +What: /sys/.../mdev_supported_types/ > id>/single_usage_restriction > > > +Date: October 2018 > > > +Contact: Kirti Wankhede > > > +Description: > > > + Reading this attribute will return Y or N. Returning Y > > indicates > > > + vendor driver has restriction of single mdev device of this > > > + particular assigned to one user space application. > > > + Returning N indicates that multiple mdev devices of > > particular > > > + can be assigned to one user space application. > > > + This is optional and readonly attribute. > > > +Users: > > > + User space application should read if > > 'single_usage_restriction' > > > + attibute is present in directory of all mdev devices > > > + which are going to be used. If all read N then user space > > > + application can proceed with multiple mdev devices. > >=20 > > But we don't say what userspace should do when this optional attribute > > is not present. Do we know of any cases other than the NVIDIA GRID > > vGPU drivers that have this restriction? Intel folks, are multiple > > GVT-g mdevs currently allowed in a VM? I don't think the libvirt > > algorithm is going to be as simple as suggested here and we should > > probably understand what it really needs to be. >=20 > technically I don't see a restriction in GVT-g side, i.e. multiple GVT-g > mdevs can be assigned to same VM. But the fact is that Intel GPU is=20 > integrated thus just one per platform. Then guest i915 driver may have=20 > problem to operate multiple vGPUs if with some assumption on integrated > part. I don't think we verified such configuration. Zhenyu? > yeah, as current intel gpu is single device, even guest i915 driver could operate but user space gfx driver is not ready for multiple devices, so won= 't be useful now. --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCW76j7gAKCRCxBBozTXgY JysHAJ9wg1ZeoQfE06amrTLFr55oqcSFGQCfclnPO0vHmMxp3HbbslP09q667+w= =fd2C -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP-- --===============5914844945179166369== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5914844945179166369==--