From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dong Jia Subject: Re: [RFC PATCH v4 1/3] Mediated device Core driver Date: Mon, 6 Jun 2016 10:24:21 +0800 Message-ID: <20160606102421.5b4757dc@oc7835276234> References: <1464119897-10844-1-git-send-email-kwankhede@nvidia.com> <1464119897-10844-2-git-send-email-kwankhede@nvidia.com> <20160603165746.3df39542@oc7835276234> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Kirti Wankhede , "alex.williamson@redhat.com" , "pbonzini@redhat.com" , "kraxel@redhat.com" , "cjia@nvidia.com" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , "Ruan, Shuai" , "Song, Jike" , "Lv, Zhiyuan" To: "Tian, Kevin" Return-path: Received: from e17.ny.us.ibm.com ([129.33.205.207]:39972 "EHLO e17.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbcFFCYe (ORCPT ); Sun, 5 Jun 2016 22:24:34 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 5 Jun 2016 22:24:33 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 3 Jun 2016 09:40:16 +0000 "Tian, Kevin" wrote: > > From: Dong Jia [mailto:bjsdjshi@linux.vnet.ibm.com] > > Sent: Friday, June 03, 2016 4:58 PM > > > > > > ...snip... > > > > > +struct phy_device_ops { > > > + struct module *owner; > > > + const struct attribute_group **dev_attr_groups; > > > + const struct attribute_group **mdev_attr_groups; > > > + > > > + int (*supported_config)(struct device *dev, char *config); > > > + int (*create)(struct device *dev, uuid_le uuid, > > > + uint32_t instance, char *mdev_params); > > > + int (*destroy)(struct device *dev, uuid_le uuid, > > > + uint32_t instance); > > > + int (*start)(uuid_le uuid); > > > + int (*shutdown)(uuid_le uuid); > > > + ssize_t (*read)(struct mdev_device *vdev, char *buf, size_t count, > > > + enum mdev_emul_space address_space, loff_t pos); > > > + ssize_t (*write)(struct mdev_device *vdev, char *buf, size_t count, > > > + enum mdev_emul_space address_space, loff_t pos); > > > + int (*set_irqs)(struct mdev_device *vdev, uint32_t flags, > > > + unsigned int index, unsigned int start, > > > + unsigned int count, void *data); > > > + int (*get_region_info)(struct mdev_device *vdev, int region_index, > > > + struct pci_region_info *region_info); > > > + int (*validate_map_request)(struct mdev_device *vdev, > > > + unsigned long virtaddr, > > > + unsigned long *pfn, unsigned long *size, > > > + pgprot_t *prot); > > > +}; > > > > Dear Kirti: > > > > When I rebased my vfio-ccw patches on this series, I found I need an > > extra 'ioctl' callback in phy_device_ops. > > > > The ccw physical device only supports one ccw mediated device. And I > > have two new ioctl commands for the ccw mediated device. One is > > to hot-reset the resource in the physical device that allocated for > > the mediated device, the other is to do an I/O instruction translation > > and perform an I/O operation on the physical device. I found the > > existing callbacks could not meet my requirements. > > > > Something like the following would be fine for my case: > > int (*ioctl)(struct mdev_device *vdev, > > unsigned int cmd, > > unsigned long arg); > > > > What do you think about this? > > > > 'reset' should be generic. better to define an individual callback > for it (then we can also expose a node under vgpu path in sysfs). > Sounds reasonable for me. :> > Thanks > Kevin > -------- Dong Jia From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9kDb-0002K5-F5 for qemu-devel@nongnu.org; Sun, 05 Jun 2016 22:24:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9kDW-00088I-DW for qemu-devel@nongnu.org; Sun, 05 Jun 2016 22:24:42 -0400 Received: from e17.ny.us.ibm.com ([129.33.205.207]:53821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9kDW-00087y-7n for qemu-devel@nongnu.org; Sun, 05 Jun 2016 22:24:38 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 5 Jun 2016 22:24:33 -0400 Date: Mon, 6 Jun 2016 10:24:21 +0800 From: Dong Jia Message-ID: <20160606102421.5b4757dc@oc7835276234> In-Reply-To: References: <1464119897-10844-1-git-send-email-kwankhede@nvidia.com> <1464119897-10844-2-git-send-email-kwankhede@nvidia.com> <20160603165746.3df39542@oc7835276234> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v4 1/3] Mediated device Core driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Tian, Kevin" Cc: Kirti Wankhede , "alex.williamson@redhat.com" , "pbonzini@redhat.com" , "kraxel@redhat.com" , "cjia@nvidia.com" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , "Ruan, Shuai" , "Song, Jike" , "Lv, Zhiyuan" On Fri, 3 Jun 2016 09:40:16 +0000 "Tian, Kevin" wrote: > > From: Dong Jia [mailto:bjsdjshi@linux.vnet.ibm.com] > > Sent: Friday, June 03, 2016 4:58 PM > > > > > > ...snip... > > > > > +struct phy_device_ops { > > > + struct module *owner; > > > + const struct attribute_group **dev_attr_groups; > > > + const struct attribute_group **mdev_attr_groups; > > > + > > > + int (*supported_config)(struct device *dev, char *config); > > > + int (*create)(struct device *dev, uuid_le uuid, > > > + uint32_t instance, char *mdev_params); > > > + int (*destroy)(struct device *dev, uuid_le uuid, > > > + uint32_t instance); > > > + int (*start)(uuid_le uuid); > > > + int (*shutdown)(uuid_le uuid); > > > + ssize_t (*read)(struct mdev_device *vdev, char *buf, size_t count, > > > + enum mdev_emul_space address_space, loff_t pos); > > > + ssize_t (*write)(struct mdev_device *vdev, char *buf, size_t count, > > > + enum mdev_emul_space address_space, loff_t pos); > > > + int (*set_irqs)(struct mdev_device *vdev, uint32_t flags, > > > + unsigned int index, unsigned int start, > > > + unsigned int count, void *data); > > > + int (*get_region_info)(struct mdev_device *vdev, int region_index, > > > + struct pci_region_info *region_info); > > > + int (*validate_map_request)(struct mdev_device *vdev, > > > + unsigned long virtaddr, > > > + unsigned long *pfn, unsigned long *size, > > > + pgprot_t *prot); > > > +}; > > > > Dear Kirti: > > > > When I rebased my vfio-ccw patches on this series, I found I need an > > extra 'ioctl' callback in phy_device_ops. > > > > The ccw physical device only supports one ccw mediated device. And I > > have two new ioctl commands for the ccw mediated device. One is > > to hot-reset the resource in the physical device that allocated for > > the mediated device, the other is to do an I/O instruction translation > > and perform an I/O operation on the physical device. I found the > > existing callbacks could not meet my requirements. > > > > Something like the following would be fine for my case: > > int (*ioctl)(struct mdev_device *vdev, > > unsigned int cmd, > > unsigned long arg); > > > > What do you think about this? > > > > 'reset' should be generic. better to define an individual callback > for it (then we can also expose a node under vgpu path in sysfs). > Sounds reasonable for me. :> > Thanks > Kevin > -------- Dong Jia