All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>, David Airlie <airlied@linux.ie>,
	"Tony Krowiak" <akrowiak@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	Harald Freudenberger <freude@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-gvt-dev@lists.freedesktop.org" 
	<intel-gvt-dev@lists.freedesktop.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Peter Oberparleiter" <oberpar@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Pierre Morel <pmorel@linux.ibm.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	"Zhenyu Wang" <zhenyuw@linux.intel.com>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>
Cc: "Raj, Ashok" <ashok.raj@intel.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	Christoph Hellwig <hch@lst.de>,
	Leon Romanovsky <leonro@nvidia.com>,
	Max Gurtovoy <mgurtovoy@nvidia.com>,
	Tarun Gupta <targupta@nvidia.com>
Subject: RE: [PATCH 18/18] vfio/mdev: Correct the function signatures for the mdev_type_attributes
Date: Fri, 26 Mar 2021 07:03:36 +0000	[thread overview]
Message-ID: <MWHPR11MB18866F9854E5E85E7D8B804F8C619@MWHPR11MB1886.namprd11.prod.outlook.com> (raw)
In-Reply-To: <18-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com>

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, March 24, 2021 1:56 AM
> 
> The driver core standard is to pass in the properly typed object, the
> properly typed attribute and the buffer data. It stems from the root
> kobject method:
> 
>   ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,..)
> 
> Each subclass of kobject should provide their own function with the same
> signature but more specific types, eg struct device uses:
> 
>   ssize_t (*show)(struct device *dev, struct device_attribute *attr,..)
> 
> In this case the existing signature is:
> 
>   ssize_t (*show)(struct kobject *kobj, struct device *dev,..)
> 
> Where kobj is a 'struct mdev_type *' and dev is 'mdev_type->parent->dev'.
> 
> Change the mdev_type related sysfs attribute functions to:
> 
>   ssize_t (*show)(struct mdev_type *mtype, struct mdev_type_attribute
> *attr,..)
> 
> In order to restore type safety and match the driver core standard
> 
> There are no current users of 'attr', but if it is ever needed it would be
> hard to add in retroactively, so do it now.
> 
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

> ---
>  drivers/gpu/drm/i915/gvt/gvt.c    | 21 +++++++++++----------
>  drivers/s390/cio/vfio_ccw_ops.c   | 15 +++++++++------
>  drivers/s390/crypto/vfio_ap_ops.c | 12 +++++++-----
>  drivers/vfio/mdev/mdev_core.c     | 14 ++++++++++++--
>  drivers/vfio/mdev/mdev_sysfs.c    | 11 ++++++-----
>  include/linux/mdev.h              | 11 +++++++----
>  samples/vfio-mdev/mbochs.c        | 26 +++++++++++++++-----------
>  samples/vfio-mdev/mdpy.c          | 24 ++++++++++++++----------
>  samples/vfio-mdev/mtty.c          | 18 +++++++++---------
>  9 files changed, 90 insertions(+), 62 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> index 4b47a18e9dfa0f..3703814a669b46 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.c
> +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> @@ -54,14 +54,15 @@ intel_gvt_find_vgpu_type(struct intel_gvt *gvt,
> unsigned int type_group_id)
>  	return &gvt->types[type_group_id];
>  }
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	struct intel_vgpu_type *type;
>  	unsigned int num = 0;
> -	void *gvt = kdev_to_i915(dev)->gvt;
> +	void *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
> 
> -	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(kobj));
> +	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(mtype));
>  	if (!type)
>  		num = 0;
>  	else
> @@ -70,19 +71,19 @@ static ssize_t available_instances_show(struct kobject
> *kobj,
>  	return sprintf(buf, "%u\n", num);
>  }
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -		char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> 
> -static ssize_t description_show(struct kobject *kobj, struct device *dev,
> -		char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	struct intel_vgpu_type *type;
> -	void *gvt = kdev_to_i915(dev)->gvt;
> +	void *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
> 
> -	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(kobj));
> +	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(mtype));
>  	if (!type)
>  		return 0;
> 
> diff --git a/drivers/s390/cio/vfio_ccw_ops.c
> b/drivers/s390/cio/vfio_ccw_ops.c
> index 06a82ec136080c..74fe21eceb66cc 100644
> --- a/drivers/s390/cio/vfio_ccw_ops.c
> +++ b/drivers/s390/cio/vfio_ccw_ops.c
> @@ -71,23 +71,26 @@ static int vfio_ccw_mdev_notifier(struct
> notifier_block *nb,
>  	return NOTIFY_DONE;
>  }
> 
> -static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "I/O subchannel (Non-QDIO)\n");
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_CCW_STRING);
>  }
>  static MDEV_TYPE_ATTR_RO(device_api);
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
> -	struct vfio_ccw_private *private = dev_get_drvdata(dev);
> +	struct vfio_ccw_private *private =
> +		dev_get_drvdata(mtype_get_parent_dev(mtype));
> 
>  	return sprintf(buf, "%d\n", atomic_read(&private->avail));
>  }
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c
> b/drivers/s390/crypto/vfio_ap_ops.c
> index 6d75ed07bcd49d..cdc5edb0074690 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -366,15 +366,17 @@ static int vfio_ap_mdev_remove(struct
> mdev_device *mdev)
>  	return 0;
>  }
> 
> -static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_AP_MDEV_NAME_HWVIRT);
>  }
> 
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	return sprintf(buf, "%d\n",
>  		       atomic_read(&matrix_dev->available_instances));
> @@ -382,8 +384,8 @@ static ssize_t available_instances_show(struct kobject
> *kobj,
> 
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_AP_STRING);
>  }
> diff --git a/drivers/vfio/mdev/mdev_core.c
> b/drivers/vfio/mdev/mdev_core.c
> index 71455812cb84cf..9ef1d5bed8069f 100644
> --- a/drivers/vfio/mdev/mdev_core.c
> +++ b/drivers/vfio/mdev/mdev_core.c
> @@ -47,12 +47,22 @@ EXPORT_SYMBOL(mdev_get_type_group_id);
>   * Used in mdev_type_attribute sysfs functions to return the index in the
>   * supported_type_groups that the sysfs is called from.
>   */
> -unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj)
> +unsigned int mtype_get_type_group_id(struct mdev_type *mtype)
>  {
> -	return container_of(mtype_kobj, struct mdev_type, kobj)-
> >type_group_id;
> +	return mtype->type_group_id;
>  }
>  EXPORT_SYMBOL(mtype_get_type_group_id);
> 
> +/*
> + * Used in mdev_type_attribute sysfs functions to return the parent struct
> + * device
> + */
> +struct device *mtype_get_parent_dev(struct mdev_type *mtype)
> +{
> +	return mtype->parent->dev;
> +}
> +EXPORT_SYMBOL(mtype_get_parent_dev);
> +
>  /* Should be called holding parent_list_lock */
>  static struct mdev_parent *__find_parent_device(struct device *dev)
>  {
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c
> b/drivers/vfio/mdev/mdev_sysfs.c
> index 91ecccdc2f2ec6..9b0f1a8757a0df 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -26,7 +26,7 @@ static ssize_t mdev_type_attr_show(struct kobject
> *kobj,
>  	ssize_t ret = -EIO;
> 
>  	if (attr->show)
> -		ret = attr->show(kobj, type->parent->dev, buf);
> +		ret = attr->show(type, attr, buf);
>  	return ret;
>  }
> 
> @@ -39,7 +39,7 @@ static ssize_t mdev_type_attr_store(struct kobject *kobj,
>  	ssize_t ret = -EIO;
> 
>  	if (attr->store)
> -		ret = attr->store(&type->kobj, type->parent->dev, buf, count);
> +		ret = attr->store(type, attr, buf, count);
>  	return ret;
>  }
> 
> @@ -48,8 +48,9 @@ static const struct sysfs_ops mdev_type_sysfs_ops = {
>  	.store = mdev_type_attr_store,
>  };
> 
> -static ssize_t create_store(struct kobject *kobj, struct device *dev,
> -			    const char *buf, size_t count)
> +static ssize_t create_store(struct mdev_type *mtype,
> +			    struct mdev_type_attribute *attr, const char *buf,
> +			    size_t count)
>  {
>  	char *str;
>  	guid_t uuid;
> @@ -67,7 +68,7 @@ static ssize_t create_store(struct kobject *kobj, struct
> device *dev,
>  	if (ret)
>  		return ret;
> 
> -	ret = mdev_device_create(to_mdev_type(kobj), &uuid);
> +	ret = mdev_device_create(mtype, &uuid);
>  	if (ret)
>  		return ret;
> 
> diff --git a/include/linux/mdev.h b/include/linux/mdev.h
> index c3a800051d6146..1fb34ea394ad46 100644
> --- a/include/linux/mdev.h
> +++ b/include/linux/mdev.h
> @@ -47,7 +47,8 @@ static inline struct device
> *mdev_get_iommu_device(struct mdev_device *mdev)
>  }
> 
>  unsigned int mdev_get_type_group_id(struct mdev_device *mdev);
> -unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj);
> +unsigned int mtype_get_type_group_id(struct mdev_type *mtype);
> +struct device *mtype_get_parent_dev(struct mdev_type *mtype);
> 
>  /**
>   * struct mdev_parent_ops - Structure to be registered for each parent
> device to
> @@ -123,9 +124,11 @@ struct mdev_parent_ops {
>  /* interface for exporting mdev supported type attributes */
>  struct mdev_type_attribute {
>  	struct attribute attr;
> -	ssize_t (*show)(struct kobject *kobj, struct device *dev, char *buf);
> -	ssize_t (*store)(struct kobject *kobj, struct device *dev,
> -			 const char *buf, size_t count);
> +	ssize_t (*show)(struct mdev_type *mtype,
> +			struct mdev_type_attribute *attr, char *buf);
> +	ssize_t (*store)(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, const char *buf,
> +			 size_t count);
>  };
> 
>  #define MDEV_TYPE_ATTR(_name, _mode, _show, _store)		\
> diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
> index ac4d0dc2490705..861c76914e7639 100644
> --- a/samples/vfio-mdev/mbochs.c
> +++ b/samples/vfio-mdev/mbochs.c
> @@ -1330,37 +1330,41 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n", kobj->name);
> +	const struct mbochs_type *type =
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
> +
> +	return sprintf(buf, "%s\n", type->name);
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -description_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	const struct mbochs_type *type =
> -		&mbochs_types[mtype_get_type_group_id(kobj)];
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
> 
>  	return sprintf(buf, "virtual display, %d MB video memory\n",
>  		       type ? type->mbytes  : 0);
>  }
>  static MDEV_TYPE_ATTR_RO(description);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	const struct mbochs_type *type =
> -		&mbochs_types[mtype_get_type_group_id(kobj)];
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
>  	int count = (max_mbytes - mbochs_used_mbytes) / type->mbytes;
> 
>  	return sprintf(buf, "%d\n", count);
>  }
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> diff --git a/samples/vfio-mdev/mdpy.c b/samples/vfio-mdev/mdpy.c
> index da88fd7dd42329..885b88ea20e234 100644
> --- a/samples/vfio-mdev/mdpy.c
> +++ b/samples/vfio-mdev/mdpy.c
> @@ -652,18 +652,21 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n", kobj->name);
> +	const struct mdpy_type *type =
> +		&mdpy_types[mtype_get_type_group_id(mtype)];
> +
> +	return sprintf(buf, "%s\n", type->name);
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -description_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	const struct mdpy_type *type =
> -		&mdpy_types[mtype_get_type_group_id(kobj)];
> +		&mdpy_types[mtype_get_type_group_id(mtype)];
> 
>  	return sprintf(buf, "virtual display, %dx%d framebuffer\n",
>  		       type ? type->width  : 0,
> @@ -671,15 +674,16 @@ description_show(struct kobject *kobj, struct
> device *dev, char *buf)
>  }
>  static MDEV_TYPE_ATTR_RO(description);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	return sprintf(buf, "%d\n", max_devices - mdpy_count);
>  }
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
> index f2e36c06ac6aa2..b9b24be4abdab7 100644
> --- a/samples/vfio-mdev/mtty.c
> +++ b/samples/vfio-mdev/mtty.c
> @@ -1292,23 +1292,24 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	static const char *name_str[2] = { "Single port serial",
>  					   "Dual port serial" };
> 
>  	return sysfs_emit(buf, "%s\n",
> -			  name_str[mtype_get_type_group_id(kobj)]);
> +			  name_str[mtype_get_type_group_id(mtype)]);
>  }
> 
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	struct mdev_state *mds;
> -	unsigned int ports = mtype_get_type_group_id(kobj) + 1;
> +	unsigned int ports = mtype_get_type_group_id(mtype) + 1;
>  	int used = 0;
> 
>  	list_for_each_entry(mds, &mdev_devices_list, next)
> @@ -1319,9 +1320,8 @@ available_instances_show(struct kobject *kobj,
> struct device *dev, char *buf)
> 
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> --
> 2.31.0


WARNING: multiple messages have this Message-ID (diff)
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>, David Airlie <airlied@linux.ie>,
	"Tony Krowiak" <akrowiak@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	 Cornelia Huck <cohuck@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	Harald Freudenberger <freude@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Peter Oberparleiter" <oberpar@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Pierre Morel <pmorel@linux.ibm.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	"Zhenyu Wang" <zhenyuw@linux.intel.com>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>
Cc: Max Gurtovoy <mgurtovoy@nvidia.com>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	Tarun Gupta <targupta@nvidia.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Christoph Hellwig <hch@lst.de>
Subject: RE: [PATCH 18/18] vfio/mdev: Correct the function signatures for the mdev_type_attributes
Date: Fri, 26 Mar 2021 07:03:36 +0000	[thread overview]
Message-ID: <MWHPR11MB18866F9854E5E85E7D8B804F8C619@MWHPR11MB1886.namprd11.prod.outlook.com> (raw)
In-Reply-To: <18-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com>

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, March 24, 2021 1:56 AM
> 
> The driver core standard is to pass in the properly typed object, the
> properly typed attribute and the buffer data. It stems from the root
> kobject method:
> 
>   ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,..)
> 
> Each subclass of kobject should provide their own function with the same
> signature but more specific types, eg struct device uses:
> 
>   ssize_t (*show)(struct device *dev, struct device_attribute *attr,..)
> 
> In this case the existing signature is:
> 
>   ssize_t (*show)(struct kobject *kobj, struct device *dev,..)
> 
> Where kobj is a 'struct mdev_type *' and dev is 'mdev_type->parent->dev'.
> 
> Change the mdev_type related sysfs attribute functions to:
> 
>   ssize_t (*show)(struct mdev_type *mtype, struct mdev_type_attribute
> *attr,..)
> 
> In order to restore type safety and match the driver core standard
> 
> There are no current users of 'attr', but if it is ever needed it would be
> hard to add in retroactively, so do it now.
> 
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

> ---
>  drivers/gpu/drm/i915/gvt/gvt.c    | 21 +++++++++++----------
>  drivers/s390/cio/vfio_ccw_ops.c   | 15 +++++++++------
>  drivers/s390/crypto/vfio_ap_ops.c | 12 +++++++-----
>  drivers/vfio/mdev/mdev_core.c     | 14 ++++++++++++--
>  drivers/vfio/mdev/mdev_sysfs.c    | 11 ++++++-----
>  include/linux/mdev.h              | 11 +++++++----
>  samples/vfio-mdev/mbochs.c        | 26 +++++++++++++++-----------
>  samples/vfio-mdev/mdpy.c          | 24 ++++++++++++++----------
>  samples/vfio-mdev/mtty.c          | 18 +++++++++---------
>  9 files changed, 90 insertions(+), 62 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> index 4b47a18e9dfa0f..3703814a669b46 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.c
> +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> @@ -54,14 +54,15 @@ intel_gvt_find_vgpu_type(struct intel_gvt *gvt,
> unsigned int type_group_id)
>  	return &gvt->types[type_group_id];
>  }
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	struct intel_vgpu_type *type;
>  	unsigned int num = 0;
> -	void *gvt = kdev_to_i915(dev)->gvt;
> +	void *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
> 
> -	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(kobj));
> +	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(mtype));
>  	if (!type)
>  		num = 0;
>  	else
> @@ -70,19 +71,19 @@ static ssize_t available_instances_show(struct kobject
> *kobj,
>  	return sprintf(buf, "%u\n", num);
>  }
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -		char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> 
> -static ssize_t description_show(struct kobject *kobj, struct device *dev,
> -		char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	struct intel_vgpu_type *type;
> -	void *gvt = kdev_to_i915(dev)->gvt;
> +	void *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
> 
> -	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(kobj));
> +	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(mtype));
>  	if (!type)
>  		return 0;
> 
> diff --git a/drivers/s390/cio/vfio_ccw_ops.c
> b/drivers/s390/cio/vfio_ccw_ops.c
> index 06a82ec136080c..74fe21eceb66cc 100644
> --- a/drivers/s390/cio/vfio_ccw_ops.c
> +++ b/drivers/s390/cio/vfio_ccw_ops.c
> @@ -71,23 +71,26 @@ static int vfio_ccw_mdev_notifier(struct
> notifier_block *nb,
>  	return NOTIFY_DONE;
>  }
> 
> -static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "I/O subchannel (Non-QDIO)\n");
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_CCW_STRING);
>  }
>  static MDEV_TYPE_ATTR_RO(device_api);
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
> -	struct vfio_ccw_private *private = dev_get_drvdata(dev);
> +	struct vfio_ccw_private *private =
> +		dev_get_drvdata(mtype_get_parent_dev(mtype));
> 
>  	return sprintf(buf, "%d\n", atomic_read(&private->avail));
>  }
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c
> b/drivers/s390/crypto/vfio_ap_ops.c
> index 6d75ed07bcd49d..cdc5edb0074690 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -366,15 +366,17 @@ static int vfio_ap_mdev_remove(struct
> mdev_device *mdev)
>  	return 0;
>  }
> 
> -static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_AP_MDEV_NAME_HWVIRT);
>  }
> 
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	return sprintf(buf, "%d\n",
>  		       atomic_read(&matrix_dev->available_instances));
> @@ -382,8 +384,8 @@ static ssize_t available_instances_show(struct kobject
> *kobj,
> 
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_AP_STRING);
>  }
> diff --git a/drivers/vfio/mdev/mdev_core.c
> b/drivers/vfio/mdev/mdev_core.c
> index 71455812cb84cf..9ef1d5bed8069f 100644
> --- a/drivers/vfio/mdev/mdev_core.c
> +++ b/drivers/vfio/mdev/mdev_core.c
> @@ -47,12 +47,22 @@ EXPORT_SYMBOL(mdev_get_type_group_id);
>   * Used in mdev_type_attribute sysfs functions to return the index in the
>   * supported_type_groups that the sysfs is called from.
>   */
> -unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj)
> +unsigned int mtype_get_type_group_id(struct mdev_type *mtype)
>  {
> -	return container_of(mtype_kobj, struct mdev_type, kobj)-
> >type_group_id;
> +	return mtype->type_group_id;
>  }
>  EXPORT_SYMBOL(mtype_get_type_group_id);
> 
> +/*
> + * Used in mdev_type_attribute sysfs functions to return the parent struct
> + * device
> + */
> +struct device *mtype_get_parent_dev(struct mdev_type *mtype)
> +{
> +	return mtype->parent->dev;
> +}
> +EXPORT_SYMBOL(mtype_get_parent_dev);
> +
>  /* Should be called holding parent_list_lock */
>  static struct mdev_parent *__find_parent_device(struct device *dev)
>  {
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c
> b/drivers/vfio/mdev/mdev_sysfs.c
> index 91ecccdc2f2ec6..9b0f1a8757a0df 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -26,7 +26,7 @@ static ssize_t mdev_type_attr_show(struct kobject
> *kobj,
>  	ssize_t ret = -EIO;
> 
>  	if (attr->show)
> -		ret = attr->show(kobj, type->parent->dev, buf);
> +		ret = attr->show(type, attr, buf);
>  	return ret;
>  }
> 
> @@ -39,7 +39,7 @@ static ssize_t mdev_type_attr_store(struct kobject *kobj,
>  	ssize_t ret = -EIO;
> 
>  	if (attr->store)
> -		ret = attr->store(&type->kobj, type->parent->dev, buf, count);
> +		ret = attr->store(type, attr, buf, count);
>  	return ret;
>  }
> 
> @@ -48,8 +48,9 @@ static const struct sysfs_ops mdev_type_sysfs_ops = {
>  	.store = mdev_type_attr_store,
>  };
> 
> -static ssize_t create_store(struct kobject *kobj, struct device *dev,
> -			    const char *buf, size_t count)
> +static ssize_t create_store(struct mdev_type *mtype,
> +			    struct mdev_type_attribute *attr, const char *buf,
> +			    size_t count)
>  {
>  	char *str;
>  	guid_t uuid;
> @@ -67,7 +68,7 @@ static ssize_t create_store(struct kobject *kobj, struct
> device *dev,
>  	if (ret)
>  		return ret;
> 
> -	ret = mdev_device_create(to_mdev_type(kobj), &uuid);
> +	ret = mdev_device_create(mtype, &uuid);
>  	if (ret)
>  		return ret;
> 
> diff --git a/include/linux/mdev.h b/include/linux/mdev.h
> index c3a800051d6146..1fb34ea394ad46 100644
> --- a/include/linux/mdev.h
> +++ b/include/linux/mdev.h
> @@ -47,7 +47,8 @@ static inline struct device
> *mdev_get_iommu_device(struct mdev_device *mdev)
>  }
> 
>  unsigned int mdev_get_type_group_id(struct mdev_device *mdev);
> -unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj);
> +unsigned int mtype_get_type_group_id(struct mdev_type *mtype);
> +struct device *mtype_get_parent_dev(struct mdev_type *mtype);
> 
>  /**
>   * struct mdev_parent_ops - Structure to be registered for each parent
> device to
> @@ -123,9 +124,11 @@ struct mdev_parent_ops {
>  /* interface for exporting mdev supported type attributes */
>  struct mdev_type_attribute {
>  	struct attribute attr;
> -	ssize_t (*show)(struct kobject *kobj, struct device *dev, char *buf);
> -	ssize_t (*store)(struct kobject *kobj, struct device *dev,
> -			 const char *buf, size_t count);
> +	ssize_t (*show)(struct mdev_type *mtype,
> +			struct mdev_type_attribute *attr, char *buf);
> +	ssize_t (*store)(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, const char *buf,
> +			 size_t count);
>  };
> 
>  #define MDEV_TYPE_ATTR(_name, _mode, _show, _store)		\
> diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
> index ac4d0dc2490705..861c76914e7639 100644
> --- a/samples/vfio-mdev/mbochs.c
> +++ b/samples/vfio-mdev/mbochs.c
> @@ -1330,37 +1330,41 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n", kobj->name);
> +	const struct mbochs_type *type =
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
> +
> +	return sprintf(buf, "%s\n", type->name);
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -description_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	const struct mbochs_type *type =
> -		&mbochs_types[mtype_get_type_group_id(kobj)];
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
> 
>  	return sprintf(buf, "virtual display, %d MB video memory\n",
>  		       type ? type->mbytes  : 0);
>  }
>  static MDEV_TYPE_ATTR_RO(description);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	const struct mbochs_type *type =
> -		&mbochs_types[mtype_get_type_group_id(kobj)];
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
>  	int count = (max_mbytes - mbochs_used_mbytes) / type->mbytes;
> 
>  	return sprintf(buf, "%d\n", count);
>  }
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> diff --git a/samples/vfio-mdev/mdpy.c b/samples/vfio-mdev/mdpy.c
> index da88fd7dd42329..885b88ea20e234 100644
> --- a/samples/vfio-mdev/mdpy.c
> +++ b/samples/vfio-mdev/mdpy.c
> @@ -652,18 +652,21 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n", kobj->name);
> +	const struct mdpy_type *type =
> +		&mdpy_types[mtype_get_type_group_id(mtype)];
> +
> +	return sprintf(buf, "%s\n", type->name);
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -description_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	const struct mdpy_type *type =
> -		&mdpy_types[mtype_get_type_group_id(kobj)];
> +		&mdpy_types[mtype_get_type_group_id(mtype)];
> 
>  	return sprintf(buf, "virtual display, %dx%d framebuffer\n",
>  		       type ? type->width  : 0,
> @@ -671,15 +674,16 @@ description_show(struct kobject *kobj, struct
> device *dev, char *buf)
>  }
>  static MDEV_TYPE_ATTR_RO(description);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	return sprintf(buf, "%d\n", max_devices - mdpy_count);
>  }
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
> index f2e36c06ac6aa2..b9b24be4abdab7 100644
> --- a/samples/vfio-mdev/mtty.c
> +++ b/samples/vfio-mdev/mtty.c
> @@ -1292,23 +1292,24 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	static const char *name_str[2] = { "Single port serial",
>  					   "Dual port serial" };
> 
>  	return sysfs_emit(buf, "%s\n",
> -			  name_str[mtype_get_type_group_id(kobj)]);
> +			  name_str[mtype_get_type_group_id(mtype)]);
>  }
> 
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	struct mdev_state *mds;
> -	unsigned int ports = mtype_get_type_group_id(kobj) + 1;
> +	unsigned int ports = mtype_get_type_group_id(mtype) + 1;
>  	int used = 0;
> 
>  	list_for_each_entry(mds, &mdev_devices_list, next)
> @@ -1319,9 +1320,8 @@ available_instances_show(struct kobject *kobj,
> struct device *dev, char *buf)
> 
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> --
> 2.31.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>, David Airlie <airlied@linux.ie>,
	"Tony Krowiak" <akrowiak@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	 Cornelia Huck <cohuck@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	Harald Freudenberger <freude@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Peter Oberparleiter" <oberpar@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Pierre Morel <pmorel@linux.ibm.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	"Zhenyu Wang" <zhenyuw@linux.intel.com>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>
Cc: Max Gurtovoy <mgurtovoy@nvidia.com>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	Tarun Gupta <targupta@nvidia.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [Intel-gfx] [PATCH 18/18] vfio/mdev: Correct the function signatures for the mdev_type_attributes
Date: Fri, 26 Mar 2021 07:03:36 +0000	[thread overview]
Message-ID: <MWHPR11MB18866F9854E5E85E7D8B804F8C619@MWHPR11MB1886.namprd11.prod.outlook.com> (raw)
In-Reply-To: <18-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com>

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, March 24, 2021 1:56 AM
> 
> The driver core standard is to pass in the properly typed object, the
> properly typed attribute and the buffer data. It stems from the root
> kobject method:
> 
>   ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,..)
> 
> Each subclass of kobject should provide their own function with the same
> signature but more specific types, eg struct device uses:
> 
>   ssize_t (*show)(struct device *dev, struct device_attribute *attr,..)
> 
> In this case the existing signature is:
> 
>   ssize_t (*show)(struct kobject *kobj, struct device *dev,..)
> 
> Where kobj is a 'struct mdev_type *' and dev is 'mdev_type->parent->dev'.
> 
> Change the mdev_type related sysfs attribute functions to:
> 
>   ssize_t (*show)(struct mdev_type *mtype, struct mdev_type_attribute
> *attr,..)
> 
> In order to restore type safety and match the driver core standard
> 
> There are no current users of 'attr', but if it is ever needed it would be
> hard to add in retroactively, so do it now.
> 
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

> ---
>  drivers/gpu/drm/i915/gvt/gvt.c    | 21 +++++++++++----------
>  drivers/s390/cio/vfio_ccw_ops.c   | 15 +++++++++------
>  drivers/s390/crypto/vfio_ap_ops.c | 12 +++++++-----
>  drivers/vfio/mdev/mdev_core.c     | 14 ++++++++++++--
>  drivers/vfio/mdev/mdev_sysfs.c    | 11 ++++++-----
>  include/linux/mdev.h              | 11 +++++++----
>  samples/vfio-mdev/mbochs.c        | 26 +++++++++++++++-----------
>  samples/vfio-mdev/mdpy.c          | 24 ++++++++++++++----------
>  samples/vfio-mdev/mtty.c          | 18 +++++++++---------
>  9 files changed, 90 insertions(+), 62 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> index 4b47a18e9dfa0f..3703814a669b46 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.c
> +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> @@ -54,14 +54,15 @@ intel_gvt_find_vgpu_type(struct intel_gvt *gvt,
> unsigned int type_group_id)
>  	return &gvt->types[type_group_id];
>  }
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	struct intel_vgpu_type *type;
>  	unsigned int num = 0;
> -	void *gvt = kdev_to_i915(dev)->gvt;
> +	void *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
> 
> -	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(kobj));
> +	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(mtype));
>  	if (!type)
>  		num = 0;
>  	else
> @@ -70,19 +71,19 @@ static ssize_t available_instances_show(struct kobject
> *kobj,
>  	return sprintf(buf, "%u\n", num);
>  }
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -		char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> 
> -static ssize_t description_show(struct kobject *kobj, struct device *dev,
> -		char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	struct intel_vgpu_type *type;
> -	void *gvt = kdev_to_i915(dev)->gvt;
> +	void *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
> 
> -	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(kobj));
> +	type = intel_gvt_find_vgpu_type(gvt,
> mtype_get_type_group_id(mtype));
>  	if (!type)
>  		return 0;
> 
> diff --git a/drivers/s390/cio/vfio_ccw_ops.c
> b/drivers/s390/cio/vfio_ccw_ops.c
> index 06a82ec136080c..74fe21eceb66cc 100644
> --- a/drivers/s390/cio/vfio_ccw_ops.c
> +++ b/drivers/s390/cio/vfio_ccw_ops.c
> @@ -71,23 +71,26 @@ static int vfio_ccw_mdev_notifier(struct
> notifier_block *nb,
>  	return NOTIFY_DONE;
>  }
> 
> -static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "I/O subchannel (Non-QDIO)\n");
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_CCW_STRING);
>  }
>  static MDEV_TYPE_ATTR_RO(device_api);
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
> -	struct vfio_ccw_private *private = dev_get_drvdata(dev);
> +	struct vfio_ccw_private *private =
> +		dev_get_drvdata(mtype_get_parent_dev(mtype));
> 
>  	return sprintf(buf, "%d\n", atomic_read(&private->avail));
>  }
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c
> b/drivers/s390/crypto/vfio_ap_ops.c
> index 6d75ed07bcd49d..cdc5edb0074690 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -366,15 +366,17 @@ static int vfio_ap_mdev_remove(struct
> mdev_device *mdev)
>  	return 0;
>  }
> 
> -static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_AP_MDEV_NAME_HWVIRT);
>  }
> 
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t available_instances_show(struct kobject *kobj,
> -					struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	return sprintf(buf, "%d\n",
>  		       atomic_read(&matrix_dev->available_instances));
> @@ -382,8 +384,8 @@ static ssize_t available_instances_show(struct kobject
> *kobj,
> 
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_AP_STRING);
>  }
> diff --git a/drivers/vfio/mdev/mdev_core.c
> b/drivers/vfio/mdev/mdev_core.c
> index 71455812cb84cf..9ef1d5bed8069f 100644
> --- a/drivers/vfio/mdev/mdev_core.c
> +++ b/drivers/vfio/mdev/mdev_core.c
> @@ -47,12 +47,22 @@ EXPORT_SYMBOL(mdev_get_type_group_id);
>   * Used in mdev_type_attribute sysfs functions to return the index in the
>   * supported_type_groups that the sysfs is called from.
>   */
> -unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj)
> +unsigned int mtype_get_type_group_id(struct mdev_type *mtype)
>  {
> -	return container_of(mtype_kobj, struct mdev_type, kobj)-
> >type_group_id;
> +	return mtype->type_group_id;
>  }
>  EXPORT_SYMBOL(mtype_get_type_group_id);
> 
> +/*
> + * Used in mdev_type_attribute sysfs functions to return the parent struct
> + * device
> + */
> +struct device *mtype_get_parent_dev(struct mdev_type *mtype)
> +{
> +	return mtype->parent->dev;
> +}
> +EXPORT_SYMBOL(mtype_get_parent_dev);
> +
>  /* Should be called holding parent_list_lock */
>  static struct mdev_parent *__find_parent_device(struct device *dev)
>  {
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c
> b/drivers/vfio/mdev/mdev_sysfs.c
> index 91ecccdc2f2ec6..9b0f1a8757a0df 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -26,7 +26,7 @@ static ssize_t mdev_type_attr_show(struct kobject
> *kobj,
>  	ssize_t ret = -EIO;
> 
>  	if (attr->show)
> -		ret = attr->show(kobj, type->parent->dev, buf);
> +		ret = attr->show(type, attr, buf);
>  	return ret;
>  }
> 
> @@ -39,7 +39,7 @@ static ssize_t mdev_type_attr_store(struct kobject *kobj,
>  	ssize_t ret = -EIO;
> 
>  	if (attr->store)
> -		ret = attr->store(&type->kobj, type->parent->dev, buf, count);
> +		ret = attr->store(type, attr, buf, count);
>  	return ret;
>  }
> 
> @@ -48,8 +48,9 @@ static const struct sysfs_ops mdev_type_sysfs_ops = {
>  	.store = mdev_type_attr_store,
>  };
> 
> -static ssize_t create_store(struct kobject *kobj, struct device *dev,
> -			    const char *buf, size_t count)
> +static ssize_t create_store(struct mdev_type *mtype,
> +			    struct mdev_type_attribute *attr, const char *buf,
> +			    size_t count)
>  {
>  	char *str;
>  	guid_t uuid;
> @@ -67,7 +68,7 @@ static ssize_t create_store(struct kobject *kobj, struct
> device *dev,
>  	if (ret)
>  		return ret;
> 
> -	ret = mdev_device_create(to_mdev_type(kobj), &uuid);
> +	ret = mdev_device_create(mtype, &uuid);
>  	if (ret)
>  		return ret;
> 
> diff --git a/include/linux/mdev.h b/include/linux/mdev.h
> index c3a800051d6146..1fb34ea394ad46 100644
> --- a/include/linux/mdev.h
> +++ b/include/linux/mdev.h
> @@ -47,7 +47,8 @@ static inline struct device
> *mdev_get_iommu_device(struct mdev_device *mdev)
>  }
> 
>  unsigned int mdev_get_type_group_id(struct mdev_device *mdev);
> -unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj);
> +unsigned int mtype_get_type_group_id(struct mdev_type *mtype);
> +struct device *mtype_get_parent_dev(struct mdev_type *mtype);
> 
>  /**
>   * struct mdev_parent_ops - Structure to be registered for each parent
> device to
> @@ -123,9 +124,11 @@ struct mdev_parent_ops {
>  /* interface for exporting mdev supported type attributes */
>  struct mdev_type_attribute {
>  	struct attribute attr;
> -	ssize_t (*show)(struct kobject *kobj, struct device *dev, char *buf);
> -	ssize_t (*store)(struct kobject *kobj, struct device *dev,
> -			 const char *buf, size_t count);
> +	ssize_t (*show)(struct mdev_type *mtype,
> +			struct mdev_type_attribute *attr, char *buf);
> +	ssize_t (*store)(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, const char *buf,
> +			 size_t count);
>  };
> 
>  #define MDEV_TYPE_ATTR(_name, _mode, _show, _store)		\
> diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
> index ac4d0dc2490705..861c76914e7639 100644
> --- a/samples/vfio-mdev/mbochs.c
> +++ b/samples/vfio-mdev/mbochs.c
> @@ -1330,37 +1330,41 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n", kobj->name);
> +	const struct mbochs_type *type =
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
> +
> +	return sprintf(buf, "%s\n", type->name);
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -description_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	const struct mbochs_type *type =
> -		&mbochs_types[mtype_get_type_group_id(kobj)];
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
> 
>  	return sprintf(buf, "virtual display, %d MB video memory\n",
>  		       type ? type->mbytes  : 0);
>  }
>  static MDEV_TYPE_ATTR_RO(description);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	const struct mbochs_type *type =
> -		&mbochs_types[mtype_get_type_group_id(kobj)];
> +		&mbochs_types[mtype_get_type_group_id(mtype)];
>  	int count = (max_mbytes - mbochs_used_mbytes) / type->mbytes;
> 
>  	return sprintf(buf, "%d\n", count);
>  }
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> diff --git a/samples/vfio-mdev/mdpy.c b/samples/vfio-mdev/mdpy.c
> index da88fd7dd42329..885b88ea20e234 100644
> --- a/samples/vfio-mdev/mdpy.c
> +++ b/samples/vfio-mdev/mdpy.c
> @@ -652,18 +652,21 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n", kobj->name);
> +	const struct mdpy_type *type =
> +		&mdpy_types[mtype_get_type_group_id(mtype)];
> +
> +	return sprintf(buf, "%s\n", type->name);
>  }
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -description_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t description_show(struct mdev_type *mtype,
> +				struct mdev_type_attribute *attr, char *buf)
>  {
>  	const struct mdpy_type *type =
> -		&mdpy_types[mtype_get_type_group_id(kobj)];
> +		&mdpy_types[mtype_get_type_group_id(mtype)];
> 
>  	return sprintf(buf, "virtual display, %dx%d framebuffer\n",
>  		       type ? type->width  : 0,
> @@ -671,15 +674,16 @@ description_show(struct kobject *kobj, struct
> device *dev, char *buf)
>  }
>  static MDEV_TYPE_ATTR_RO(description);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	return sprintf(buf, "%d\n", max_devices - mdpy_count);
>  }
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
> index f2e36c06ac6aa2..b9b24be4abdab7 100644
> --- a/samples/vfio-mdev/mtty.c
> +++ b/samples/vfio-mdev/mtty.c
> @@ -1292,23 +1292,24 @@ static const struct attribute_group
> *mdev_dev_groups[] = {
>  	NULL,
>  };
> 
> -static ssize_t
> -name_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t name_show(struct mdev_type *mtype,
> +			 struct mdev_type_attribute *attr, char *buf)
>  {
>  	static const char *name_str[2] = { "Single port serial",
>  					   "Dual port serial" };
> 
>  	return sysfs_emit(buf, "%s\n",
> -			  name_str[mtype_get_type_group_id(kobj)]);
> +			  name_str[mtype_get_type_group_id(mtype)]);
>  }
> 
>  static MDEV_TYPE_ATTR_RO(name);
> 
> -static ssize_t
> -available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +static ssize_t available_instances_show(struct mdev_type *mtype,
> +					struct mdev_type_attribute *attr,
> +					char *buf)
>  {
>  	struct mdev_state *mds;
> -	unsigned int ports = mtype_get_type_group_id(kobj) + 1;
> +	unsigned int ports = mtype_get_type_group_id(mtype) + 1;
>  	int used = 0;
> 
>  	list_for_each_entry(mds, &mdev_devices_list, next)
> @@ -1319,9 +1320,8 @@ available_instances_show(struct kobject *kobj,
> struct device *dev, char *buf)
> 
>  static MDEV_TYPE_ATTR_RO(available_instances);
> 
> -
> -static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> -			       char *buf)
> +static ssize_t device_api_show(struct mdev_type *mtype,
> +			       struct mdev_type_attribute *attr, char *buf)
>  {
>  	return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
>  }
> --
> 2.31.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2021-03-26  7:04 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 17:55 [PATCH 00/18] Make vfio_mdev type safe Jason Gunthorpe
2021-03-23 17:55 ` [Intel-gfx] " Jason Gunthorpe
2021-03-23 17:55 ` Jason Gunthorpe
2021-03-23 17:55 ` [PATCH 01/18] vfio/mdev: Fix missing static's on MDEV_TYPE_ATTR's Jason Gunthorpe
2021-03-23 17:55 ` [PATCH 02/18] vfio/mdev: Add missing typesafety around mdev_device Jason Gunthorpe
2021-03-26  2:04   ` Tian, Kevin
2021-03-30 15:24   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 03/18] vfio/mdev: Simplify driver registration Jason Gunthorpe
2021-03-23 19:14   ` Christoph Hellwig
2021-03-26 12:10     ` Jason Gunthorpe
2021-03-26 12:55       ` Christoph Hellwig
2021-03-26  2:17   ` Tian, Kevin
2021-03-30 15:28   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 04/18] vfio/mdev: Use struct mdev_type in struct mdev_device Jason Gunthorpe
2021-03-23 19:15   ` Christoph Hellwig
2021-03-26  2:29   ` Tian, Kevin
2021-04-06 18:41     ` Jason Gunthorpe
2021-03-30 15:31   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 05/18] vfio/mdev: Do not allow a mdev_type to have a NULL parent pointer Jason Gunthorpe
2021-03-23 19:15   ` Christoph Hellwig
2021-04-06 16:08     ` Jason Gunthorpe
2021-03-26  2:38   ` Tian, Kevin
2021-03-29  8:42   ` Max Gurtovoy
2021-03-30 15:34   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 06/18] vfio/mdev: Expose mdev_get/put_parent to mdev_private.h Jason Gunthorpe
2021-03-23 19:16   ` Christoph Hellwig
2021-03-26  2:47   ` Tian, Kevin
2021-03-30 15:37   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 07/18] vfio/mdev: Add missing reference counting to mdev_type Jason Gunthorpe
2021-03-23 19:17   ` Christoph Hellwig
2021-03-26  2:52   ` Tian, Kevin
2021-03-30 15:38   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 08/18] vfio/mdev: Reorganize mdev_device_create() Jason Gunthorpe
2021-03-23 19:20   ` Christoph Hellwig
2021-03-26  3:33     ` Tian, Kevin
2021-03-26  3:36       ` Tian, Kevin
2021-04-06 16:40     ` Jason Gunthorpe
2021-03-26  3:31   ` Tian, Kevin
2021-03-30 15:50   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 09/18] vfio/mdev: Add missing error handling to dev_set_name() Jason Gunthorpe
2021-03-23 19:21   ` Christoph Hellwig
2021-03-26  3:35   ` Tian, Kevin
2021-03-29  8:50   ` Max Gurtovoy
2021-03-30 15:53   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 10/18] vfio/mdev: Remove duplicate storage of parent in mdev_device Jason Gunthorpe
2021-03-23 19:22   ` Christoph Hellwig
2021-03-26  3:53   ` Tian, Kevin
2021-03-26 11:53     ` Jason Gunthorpe
2021-03-30 16:14       ` Cornelia Huck
2021-03-30 16:50         ` Jason Gunthorpe
2021-03-30 16:15   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 11/18] vfio/mdev: Add mdev/mtype_get_type_group_id() Jason Gunthorpe
2021-03-23 19:23   ` Christoph Hellwig
2021-04-06 18:53     ` Jason Gunthorpe
2021-03-26  5:52   ` Tian, Kevin
2021-03-30 16:26   ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 12/18] vfio/mtty: Use mdev_get_type_group_id() Jason Gunthorpe
2021-03-23 19:24   ` Christoph Hellwig
2021-03-23 17:55 ` [PATCH 13/18] vfio/mdpy: " Jason Gunthorpe
2021-03-23 19:25   ` Christoph Hellwig
2021-03-23 17:55 ` [PATCH 14/18] vfio/mbochs: " Jason Gunthorpe
2021-03-23 19:25   ` Christoph Hellwig
2021-03-23 17:55 ` [PATCH 15/18] vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV Jason Gunthorpe
2021-03-23 17:55   ` [Intel-gfx] " Jason Gunthorpe
2021-03-23 19:26   ` Christoph Hellwig
2021-03-23 19:39     ` Jason Gunthorpe
2021-03-23 19:39       ` [Intel-gfx] " Jason Gunthorpe
2021-03-30  4:39       ` Zhenyu Wang
2021-03-30  4:39         ` Zhenyu Wang
2021-03-26  6:03   ` Tian, Kevin
2021-03-26  6:03     ` Tian, Kevin
2021-03-23 17:55 ` [PATCH 16/18] vfio/gvt: Use mdev_get_type_group_id() Jason Gunthorpe
2021-03-23 17:55   ` [Intel-gfx] " Jason Gunthorpe
2021-03-23 19:28   ` Christoph Hellwig
2021-03-26  6:09   ` Tian, Kevin
2021-03-26  6:09     ` [Intel-gfx] " Tian, Kevin
2021-03-23 17:55 ` [PATCH 17/18] vfio/mdev: Remove kobj from mdev_parent_ops->create() Jason Gunthorpe
2021-03-23 17:55   ` [Intel-gfx] " Jason Gunthorpe
2021-03-23 17:55   ` Jason Gunthorpe
2021-03-23 19:29   ` Christoph Hellwig
2021-03-23 19:29     ` [Intel-gfx] " Christoph Hellwig
2021-03-26  6:11   ` Tian, Kevin
2021-03-26  6:11     ` [Intel-gfx] " Tian, Kevin
2021-03-26  6:11     ` Tian, Kevin
2021-03-30 16:29   ` Cornelia Huck
2021-03-30 16:29     ` [Intel-gfx] " Cornelia Huck
2021-03-30 16:29     ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 18/18] vfio/mdev: Correct the function signatures for the mdev_type_attributes Jason Gunthorpe
2021-03-23 17:55   ` [Intel-gfx] " Jason Gunthorpe
2021-03-23 17:55   ` Jason Gunthorpe
2021-03-23 19:31   ` Christoph Hellwig
2021-03-23 19:31     ` [Intel-gfx] " Christoph Hellwig
2021-04-06 18:34     ` Jason Gunthorpe
2021-04-06 18:34       ` [Intel-gfx] " Jason Gunthorpe
2021-04-06 18:34       ` Jason Gunthorpe
2021-03-26  7:03   ` Tian, Kevin [this message]
2021-03-26  7:03     ` [Intel-gfx] " Tian, Kevin
2021-03-26  7:03     ` Tian, Kevin
2021-03-30 16:35   ` Cornelia Huck
2021-03-30 16:35     ` [Intel-gfx] " Cornelia Huck
2021-03-30 16:35     ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR11MB18866F9854E5E85E7D8B804F8C619@MWHPR11MB1886.namprd11.prod.outlook.com \
    --to=kevin.tian@intel.com \
    --cc=airlied@linux.ie \
    --cc=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=ashok.raj@intel.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=farman@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jgg@nvidia.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=mgurtovoy@nvidia.com \
    --cc=oberpar@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=targupta@nvidia.com \
    --cc=vneethv@linux.ibm.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhi.a.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.