All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jike Song <jike.song@intel.com>
To: Kirti Wankhede <kwankhede@nvidia.com>
Cc: kevin.tian@intel.com, cjia@nvidia.com, kvm@vger.kernel.org,
	qemu-devel@nongnu.org, alex.williamson@redhat.com,
	kraxel@redhat.com, pbonzini@redhat.com,
	bjsdjshi@linux.vnet.ibm.com
Subject: Re: [PATCH v8 0/6] Add Mediated device support
Date: Tue, 11 Oct 2016 10:23:22 +0800	[thread overview]
Message-ID: <57FC4D1A.30802@intel.com> (raw)
In-Reply-To: <1476131317-358-1-git-send-email-kwankhede@nvidia.com>

On 10/11/2016 04:28 AM, Kirti Wankhede wrote:
> This series adds Mediated device support to Linux host kernel. Purpose
> of this series is to provide a common interface for mediated device
> management that can be used by different devices. This series introduces
> Mdev core module that creates and manages mediated devices, VFIO based
> driver for mediated devices that are created by mdev core module and
> update VFIO type1 IOMMU module to support pinning & unpinning for mediated
> devices.
> 
> This change uses uuid_le_to_bin() to parse UUID string and convert to bin.
> This requires following commits from linux master branch:
> * commit bc9dc9d5eec908806f1b15c9ec2253d44dcf7835 :
>         lib/uuid.c: use correct offset in uuid parser
> * commit 2b1b0d66704a8cafe83be7114ec4c15ab3a314ad :
>         lib/uuid.c: introduce a few more generic helpers
> 
> Requires below commits from linux master branch for mmap region fault
> handler that uses remap_pfn_range() to setup EPT properly.
> * commit add6a0cd1c5ba51b201e1361b05a5df817083618
>         KVM: MMU: try to fix up page faults before giving up
> * commit 92176a8ede577d0ff78ab3298e06701f67ad5f51 :
>         KVM: MMU: prepare to support mapping of VM_IO and VM_PFNMAP frames
> 
> What changed in v8?
> mdev-core:
> - Removed start/stop or online/offline interfaces.
> - Added open() and close() interfaces that should be used to commit
>   resources for mdev devices from vendor driver.
> - Removed supported_config callback function. Introduced sysfs interface
>   for 'mdev_supported_types' as discussed earlier. It is mandatory to
>   provide supported types by vendor driver.
> - Removed 'mdev_create' and 'mdev_destroy' sysfs files from device's
>   directory. Added 'create' file in each supported type group that vendor
>   driver would define. Added 'remove' file in mdev device directory to
>   destroy mdev device.
> 
> vfio_mdev:
> - Added ioctl() callback. All ioctls should be handled in vendor driver
> - Common functions for SET_IRQS and GET_REGION_INFO ioctls are added to
>   reduce code duplication in vendor drivers.
> - This forms a shim layer that pass through VFIO devices operations to
>   vendor driver for mediated devices.

Hi Kirti,

While having not looked yet at the v8 details, I would say that this is
definitely the right way to go, as I have been proposing for a quite long
while :)

--
Thanks,
Jike

> 
> vfio_iommu_type1:
> - Handled the case if all devices attached to the normal IOMMU API domain
>   go away and mdev device still exist in domain. Updated page accounting
>   for local domain.
> - Similarly if device is attached to normal IOMMU API domain, mappings are
>   establised and page accounting is updated accordingly.
> - Tested hot-plug and hot-unplug of vGPU and GPU pass through device with
>   Linux VM.
> 
> Documentation:
> - Updated vfio-mediated-device.txt with current interface.
> - Added sample driver that simulates serial port over PCI card for a VM.
>   This driver is added as an example for how to use mediated device
>   framework.
> - Moved updated document and example driver to 'vfio-mdev' directory in
>   Documentation.
> 
> 
> Kirti Wankhede (6):
>   vfio: Mediated device Core driver
>   vfio: VFIO based driver for Mediated devices
>   vfio iommu: Add support for mediated devices
>   docs: Add Documentation for Mediated devices
>   Add simple sample driver for mediated device framework
>   Add common functions for SET_IRQS and GET_REGION_INFO ioctls
> 
>  Documentation/vfio-mdev/Makefile                 |   14 +
>  Documentation/vfio-mdev/mtty.c                   | 1353 ++++++++++++++++++++++
>  Documentation/vfio-mdev/vfio-mediated-device.txt |  282 +++++
>  drivers/vfio/Kconfig                             |    1 +
>  drivers/vfio/Makefile                            |    1 +
>  drivers/vfio/mdev/Kconfig                        |   18 +
>  drivers/vfio/mdev/Makefile                       |    6 +
>  drivers/vfio/mdev/mdev_core.c                    |  363 ++++++
>  drivers/vfio/mdev/mdev_driver.c                  |  131 +++
>  drivers/vfio/mdev/mdev_private.h                 |   41 +
>  drivers/vfio/mdev/mdev_sysfs.c                   |  295 +++++
>  drivers/vfio/mdev/vfio_mdev.c                    |  171 +++
>  drivers/vfio/pci/vfio_pci.c                      |  103 +-
>  drivers/vfio/pci/vfio_pci_private.h              |    6 +-
>  drivers/vfio/vfio.c                              |  233 ++++
>  drivers/vfio/vfio_iommu_type1.c                  |  685 +++++++++--
>  include/linux/mdev.h                             |  178 +++
>  include/linux/vfio.h                             |   20 +-
>  18 files changed, 3743 insertions(+), 158 deletions(-)
>  create mode 100644 Documentation/vfio-mdev/Makefile
>  create mode 100644 Documentation/vfio-mdev/mtty.c
>  create mode 100644 Documentation/vfio-mdev/vfio-mediated-device.txt
>  create mode 100644 drivers/vfio/mdev/Kconfig
>  create mode 100644 drivers/vfio/mdev/Makefile
>  create mode 100644 drivers/vfio/mdev/mdev_core.c
>  create mode 100644 drivers/vfio/mdev/mdev_driver.c
>  create mode 100644 drivers/vfio/mdev/mdev_private.h
>  create mode 100644 drivers/vfio/mdev/mdev_sysfs.c
>  create mode 100644 drivers/vfio/mdev/vfio_mdev.c
>  create mode 100644 include/linux/mdev.h
> 

WARNING: multiple messages have this Message-ID (diff)
From: Jike Song <jike.song@intel.com>
To: Kirti Wankhede <kwankhede@nvidia.com>
Cc: alex.williamson@redhat.com, pbonzini@redhat.com,
	kraxel@redhat.com, cjia@nvidia.com, qemu-devel@nongnu.org,
	kvm@vger.kernel.org, kevin.tian@intel.com,
	bjsdjshi@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v8 0/6] Add Mediated device support
Date: Tue, 11 Oct 2016 10:23:22 +0800	[thread overview]
Message-ID: <57FC4D1A.30802@intel.com> (raw)
In-Reply-To: <1476131317-358-1-git-send-email-kwankhede@nvidia.com>

On 10/11/2016 04:28 AM, Kirti Wankhede wrote:
> This series adds Mediated device support to Linux host kernel. Purpose
> of this series is to provide a common interface for mediated device
> management that can be used by different devices. This series introduces
> Mdev core module that creates and manages mediated devices, VFIO based
> driver for mediated devices that are created by mdev core module and
> update VFIO type1 IOMMU module to support pinning & unpinning for mediated
> devices.
> 
> This change uses uuid_le_to_bin() to parse UUID string and convert to bin.
> This requires following commits from linux master branch:
> * commit bc9dc9d5eec908806f1b15c9ec2253d44dcf7835 :
>         lib/uuid.c: use correct offset in uuid parser
> * commit 2b1b0d66704a8cafe83be7114ec4c15ab3a314ad :
>         lib/uuid.c: introduce a few more generic helpers
> 
> Requires below commits from linux master branch for mmap region fault
> handler that uses remap_pfn_range() to setup EPT properly.
> * commit add6a0cd1c5ba51b201e1361b05a5df817083618
>         KVM: MMU: try to fix up page faults before giving up
> * commit 92176a8ede577d0ff78ab3298e06701f67ad5f51 :
>         KVM: MMU: prepare to support mapping of VM_IO and VM_PFNMAP frames
> 
> What changed in v8?
> mdev-core:
> - Removed start/stop or online/offline interfaces.
> - Added open() and close() interfaces that should be used to commit
>   resources for mdev devices from vendor driver.
> - Removed supported_config callback function. Introduced sysfs interface
>   for 'mdev_supported_types' as discussed earlier. It is mandatory to
>   provide supported types by vendor driver.
> - Removed 'mdev_create' and 'mdev_destroy' sysfs files from device's
>   directory. Added 'create' file in each supported type group that vendor
>   driver would define. Added 'remove' file in mdev device directory to
>   destroy mdev device.
> 
> vfio_mdev:
> - Added ioctl() callback. All ioctls should be handled in vendor driver
> - Common functions for SET_IRQS and GET_REGION_INFO ioctls are added to
>   reduce code duplication in vendor drivers.
> - This forms a shim layer that pass through VFIO devices operations to
>   vendor driver for mediated devices.

Hi Kirti,

While having not looked yet at the v8 details, I would say that this is
definitely the right way to go, as I have been proposing for a quite long
while :)

--
Thanks,
Jike

> 
> vfio_iommu_type1:
> - Handled the case if all devices attached to the normal IOMMU API domain
>   go away and mdev device still exist in domain. Updated page accounting
>   for local domain.
> - Similarly if device is attached to normal IOMMU API domain, mappings are
>   establised and page accounting is updated accordingly.
> - Tested hot-plug and hot-unplug of vGPU and GPU pass through device with
>   Linux VM.
> 
> Documentation:
> - Updated vfio-mediated-device.txt with current interface.
> - Added sample driver that simulates serial port over PCI card for a VM.
>   This driver is added as an example for how to use mediated device
>   framework.
> - Moved updated document and example driver to 'vfio-mdev' directory in
>   Documentation.
> 
> 
> Kirti Wankhede (6):
>   vfio: Mediated device Core driver
>   vfio: VFIO based driver for Mediated devices
>   vfio iommu: Add support for mediated devices
>   docs: Add Documentation for Mediated devices
>   Add simple sample driver for mediated device framework
>   Add common functions for SET_IRQS and GET_REGION_INFO ioctls
> 
>  Documentation/vfio-mdev/Makefile                 |   14 +
>  Documentation/vfio-mdev/mtty.c                   | 1353 ++++++++++++++++++++++
>  Documentation/vfio-mdev/vfio-mediated-device.txt |  282 +++++
>  drivers/vfio/Kconfig                             |    1 +
>  drivers/vfio/Makefile                            |    1 +
>  drivers/vfio/mdev/Kconfig                        |   18 +
>  drivers/vfio/mdev/Makefile                       |    6 +
>  drivers/vfio/mdev/mdev_core.c                    |  363 ++++++
>  drivers/vfio/mdev/mdev_driver.c                  |  131 +++
>  drivers/vfio/mdev/mdev_private.h                 |   41 +
>  drivers/vfio/mdev/mdev_sysfs.c                   |  295 +++++
>  drivers/vfio/mdev/vfio_mdev.c                    |  171 +++
>  drivers/vfio/pci/vfio_pci.c                      |  103 +-
>  drivers/vfio/pci/vfio_pci_private.h              |    6 +-
>  drivers/vfio/vfio.c                              |  233 ++++
>  drivers/vfio/vfio_iommu_type1.c                  |  685 +++++++++--
>  include/linux/mdev.h                             |  178 +++
>  include/linux/vfio.h                             |   20 +-
>  18 files changed, 3743 insertions(+), 158 deletions(-)
>  create mode 100644 Documentation/vfio-mdev/Makefile
>  create mode 100644 Documentation/vfio-mdev/mtty.c
>  create mode 100644 Documentation/vfio-mdev/vfio-mediated-device.txt
>  create mode 100644 drivers/vfio/mdev/Kconfig
>  create mode 100644 drivers/vfio/mdev/Makefile
>  create mode 100644 drivers/vfio/mdev/mdev_core.c
>  create mode 100644 drivers/vfio/mdev/mdev_driver.c
>  create mode 100644 drivers/vfio/mdev/mdev_private.h
>  create mode 100644 drivers/vfio/mdev/mdev_sysfs.c
>  create mode 100644 drivers/vfio/mdev/vfio_mdev.c
>  create mode 100644 include/linux/mdev.h
> 

  parent reply	other threads:[~2016-10-11  2:23 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 20:28 [PATCH v8 0/6] Add Mediated device support Kirti Wankhede
2016-10-10 20:28 ` [Qemu-devel] " Kirti Wankhede
2016-10-10 20:28 ` [PATCH v8 1/6] vfio: Mediated device Core driver Kirti Wankhede
2016-10-10 20:28   ` [Qemu-devel] " Kirti Wankhede
2016-10-10 21:00   ` Eric Blake
2016-10-10 21:00     ` Eric Blake
2016-10-11  3:51   ` Alex Williamson
2016-10-11  3:51     ` [Qemu-devel] " Alex Williamson
2016-10-11 20:13     ` Kirti Wankhede
2016-10-11 20:13       ` [Qemu-devel] " Kirti Wankhede
2016-10-12  8:39   ` Tian, Kevin
2016-10-12  8:39     ` [Qemu-devel] " Tian, Kevin
2016-10-10 20:28 ` [PATCH v8 2/6] vfio: VFIO based driver for Mediated devices Kirti Wankhede
2016-10-10 20:28   ` [Qemu-devel] " Kirti Wankhede
2016-10-11  3:55   ` Alex Williamson
2016-10-11  3:55     ` [Qemu-devel] " Alex Williamson
2016-10-11 20:24     ` Kirti Wankhede
2016-10-11 20:24       ` [Qemu-devel] " Kirti Wankhede
2016-10-10 20:28 ` [PATCH v8 3/6] vfio iommu: Add support for mediated devices Kirti Wankhede
2016-10-10 20:28   ` [Qemu-devel] " Kirti Wankhede
2016-10-11 22:06   ` Alex Williamson
2016-10-11 22:06     ` [Qemu-devel] " Alex Williamson
2016-10-12 10:38     ` Tian, Kevin
2016-10-12 10:38       ` [Qemu-devel] " Tian, Kevin
2016-10-13 14:34     ` Kirti Wankhede
2016-10-13 14:34       ` [Qemu-devel] " Kirti Wankhede
2016-10-13 17:12       ` Alex Williamson
2016-10-13 17:12         ` [Qemu-devel] " Alex Williamson
2016-10-12 10:31   ` Tian, Kevin
2016-10-12 10:31     ` [Qemu-devel] " Tian, Kevin
2016-10-14 11:35     ` Kirti Wankhede
2016-10-14 11:35       ` [Qemu-devel] " Kirti Wankhede
2016-10-14 12:29       ` Tian, Kevin
2016-10-14 12:29         ` [Qemu-devel] " Tian, Kevin
2016-10-10 20:28 ` [PATCH v8 4/6] docs: Add Documentation for Mediated devices Kirti Wankhede
2016-10-10 20:28   ` [Qemu-devel] " Kirti Wankhede
2016-10-11 14:14   ` Daniel P. Berrange
2016-10-11 20:44     ` Kirti Wankhede
2016-10-11 20:44       ` Kirti Wankhede
2016-10-12  1:52       ` Tian, Kevin
2016-10-12  1:52         ` [Qemu-devel] " Tian, Kevin
2016-10-12 15:13         ` Kirti Wankhede
2016-10-12 15:13           ` [Qemu-devel] " Kirti Wankhede
2016-10-12 15:59           ` Alex Williamson
2016-10-12 15:59             ` [Qemu-devel] " Alex Williamson
2016-10-12 19:02             ` Kirti Wankhede
2016-10-12 19:02               ` [Qemu-devel] " Kirti Wankhede
2016-10-12 21:44               ` Alex Williamson
2016-10-13  9:22                 ` Kirti Wankhede
2016-10-13 14:36                   ` Alex Williamson
2016-10-13 14:36                     ` [Qemu-devel] " Alex Williamson
2016-10-13 16:00                     ` Paolo Bonzini
2016-10-13 16:00                       ` [Qemu-devel] " Paolo Bonzini
2016-10-13 16:30                       ` Alex Williamson
2016-10-14  3:31                     ` Kirti Wankhede
2016-10-14  4:22                       ` Alex Williamson
2016-10-14  4:22                         ` [Qemu-devel] " Alex Williamson
2016-10-13  3:27               ` Tian, Kevin
2016-10-13  3:27                 ` [Qemu-devel] " Tian, Kevin
2016-10-14  2:22   ` Jike Song
2016-10-14  2:22     ` [Qemu-devel] " Jike Song
2016-10-14  3:15     ` Kirti Wankhede
2016-10-14  3:15       ` [Qemu-devel] " Kirti Wankhede
2016-10-10 20:28 ` [PATCH v8 5/6] Add simple sample driver for mediated device framework Kirti Wankhede
2016-10-10 20:28   ` [Qemu-devel] " Kirti Wankhede
2016-10-10 20:28 ` [PATCH v8 6/6] Add common functions for SET_IRQS and GET_REGION_INFO ioctls Kirti Wankhede
2016-10-10 20:28   ` [Qemu-devel] " Kirti Wankhede
2016-10-11 23:18   ` Alex Williamson
2016-10-11 23:18     ` [Qemu-devel] " Alex Williamson
2016-10-12 19:37     ` Kirti Wankhede
2016-10-12 19:37       ` [Qemu-devel] " Kirti Wankhede
2016-10-11  2:23 ` Jike Song [this message]
2016-10-11  2:23   ` [Qemu-devel] [PATCH v8 0/6] Add Mediated device support Jike Song

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=57FC4D1A.30802@intel.com \
    --to=jike.song@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=bjsdjshi@linux.vnet.ibm.com \
    --cc=cjia@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.