Re: [Qemu-devel] [PATCH v9 00/12] Add Mediated device support

2016-12-05 Thread Jike Song
On 12/06/2016 01:44 AM, Gerd Hoffmann wrote: > Hi, > >> Just want to share that we have published a KVMGT implementation >> based on this v9 patchset, to: >> >> https://github.com/01org/gvt-linux/tree/gvt-next-kvmgt >> >> It doesn't utilize common routines introduced by 05+ patches yet. >>

Re: [Qemu-devel] [PATCH v14 00/22] Add Mediated device support

2016-11-17 Thread Jike Song
On 11/18/2016 10:00 AM, Kirti Wankhede wrote: > On 11/18/2016 3:35 AM, Neo Jia wrote: >> On Thu, Nov 17, 2016 at 02:25:15PM -0700, Alex Williamson wrote: >>> On Thu, 17 Nov 2016 02:16:12 +0530 >>> Kirti Wankhede wrote: Documentation/ABI/testing/sysfs-bus-vfio-mdev

Re: [Qemu-devel] [PATCH v14 12/22] vfio: Add notifier callback to parent's ops structure of mdev

2016-11-17 Thread Jike Song
On 11/17/2016 04:46 AM, Kirti Wankhede wrote: > Add a notifier calback to parent's ops structure of mdev device so that per > device notifer for vfio module is registered through vfio_mdev module. > > Signed-off-by: Kirti Wankhede > Signed-off-by: Neo Jia

Re: [Qemu-devel] [PATCH v14 11/22] vfio iommu: Add blocking notifier to notify DMA_UNMAP

2016-11-16 Thread Jike Song
On 11/17/2016 04:46 AM, Kirti Wankhede wrote: > Added blocking notifier to IOMMU TYPE1 driver to notify vendor drivers > about DMA_UNMAP. > Exported two APIs vfio_register_notifier() and vfio_unregister_notifier(). > Notifier should be registered, if external user wants to use >

Re: [Qemu-devel] [PATCH v12 12/22] vfio: Add notifier callback to parent's ops structure of mdev

2016-11-15 Thread Jike Song
On 11/15/2016 11:19 PM, Alex Williamson wrote: > On Tue, 15 Nov 2016 14:45:42 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 11/14/2016 11:42 PM, Kirti Wankhede wrote: >>> Add a notifier calback to parent's ops structure of mdev device so that per >

Re: [Qemu-devel] [PATCH v12 12/22] vfio: Add notifier callback to parent's ops structure of mdev

2016-11-15 Thread Jike Song
On 11/15/2016 04:11 PM, Kirti Wankhede wrote: > > > On 11/15/2016 12:15 PM, Jike Song wrote: >> On 11/14/2016 11:42 PM, Kirti Wankhede wrote: >>> Add a notifier calback to parent's ops structure of mdev device so that per >>> device notifer for vfio module is re

Re: [Qemu-devel] [PATCH v12 12/22] vfio: Add notifier callback to parent's ops structure of mdev

2016-11-14 Thread Jike Song
On 11/14/2016 11:42 PM, Kirti Wankhede wrote: > Add a notifier calback to parent's ops structure of mdev device so that per > device notifer for vfio module is registered through vfio_mdev module. > > Signed-off-by: Kirti Wankhede > Signed-off-by: Neo Jia

Re: [Qemu-devel] [PATCH v11 10/22] vfio iommu type1: Add support for mediated devices

2016-11-07 Thread Jike Song
On 11/08/2016 07:16 AM, Alex Williamson wrote: > On Sat, 5 Nov 2016 02:40:44 +0530 > Kirti Wankhede wrote: > >> VFIO IOMMU drivers are designed for the devices which are IOMMU capable. >> Mediated device only uses IOMMU APIs, the underlying hardware can be >> managed by an

Re: [Qemu-devel] [PATCH v10 08/19] vfio iommu type1: Add find_iommu_group() function

2016-11-02 Thread Jike Song
* last domain, then all the mappings go away too. > + */ > + if (list_empty(>group_list)) { > + if (list_is_singular(>domain_list)) > + vfio_iommu_unmap_unpin_all(iommu); > + iommu_domain_free(domain->domain); > + list_del(>next); > + kfree(domain); > } > + goto done; > } > > done: > Reviewed-by: Jike Song <jike.s...@intel.com> -- Thanks, Jike

Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated devices

2016-11-02 Thread Jike Song
On 11/02/2016 09:18 PM, Kirti Wankhede wrote: > On 11/2/2016 6:30 PM, Jike Song wrote: >> On 11/02/2016 08:41 PM, Kirti Wankhede wrote: >>> On 11/2/2016 5:51 PM, Jike Song wrote: >>>> On 11/02/2016 12:09 PM, Alexey Kardashevskiy wrote: >>>>> O

Re: [Qemu-devel] [PATCH v10 09/19] vfio iommu type1: Add support for mediated devices

2016-11-02 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > VFIO IOMMU drivers are designed for the devices which are IOMMU capable. > Mediated device only uses IOMMU APIs, the underlying hardware can be > managed by an IOMMU domain. > > Aim of this change is: > - To use most of the code of TYPE1 IOMMU

Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated devices

2016-11-02 Thread Jike Song
On 11/02/2016 08:41 PM, Kirti Wankhede wrote: > On 11/2/2016 5:51 PM, Jike Song wrote: >> On 11/02/2016 12:09 PM, Alexey Kardashevskiy wrote: >>> Or you could just reference and use @mm as KVM and others do. Or there is >>> anything else you need from @current than

Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated devices

2016-11-02 Thread Jike Song
On 11/02/2016 12:09 PM, Alexey Kardashevskiy wrote: > On 02/11/16 14:29, Kirti Wankhede wrote: >> >> >> On 11/2/2016 6:54 AM, Alexey Kardashevskiy wrote: >>> On 02/11/16 01:01, Kirti Wankhede wrote: On 10/28/2016 7:48 AM, Alexey Kardashevskiy wrote: > On 27/10/16 23:31, Kirti

Re: [Qemu-devel] [PATCH v10 04/19] vfio: Common function to increment container_users

2016-11-02 Thread Jike Song
return ERR_PTR(-EPERM); > - } > - > - if (!group->container->iommu_driver || > - !vfio_group_viable(group)) { > - atomic_dec(>container_users); > - return ERR_PTR(-EINVAL); > - } > + ret = vfio_group_add_container_user(group); > + if (ret) > + return ERR_PTR(ret); > > vfio_group_get(group); > Reviewed-by: Jike Song <jike.s...@intel.com> -- Thanks, Jike

Re: [Qemu-devel] [PATCH v10 02/19] vfio: VFIO based driver for Mediated devices

2016-11-02 Thread Jike Song
evice *mdev = to_mdev_device(dev); > + > + return vfio_add_group_dev(dev, _mdev_dev_ops, mdev); > +} > + > +void vfio_mdev_remove(struct device *dev) > +{ > + vfio_del_group_dev(dev); > +} > + > +struct mdev_driver vfio_mdev_driver = { > + .name = "vfio_mdev", > + .probe = vfio_mdev_probe, > + .remove = vfio_mdev_remove, > +}; > + > +static int __init vfio_mdev_init(void) > +{ > + return mdev_register_driver(_mdev_driver, THIS_MODULE); > +} > + > +static void __exit vfio_mdev_exit(void) > +{ > + mdev_unregister_driver(_mdev_driver); > +} > + > +module_init(vfio_mdev_init) > +module_exit(vfio_mdev_exit) > + > +MODULE_VERSION(DRIVER_VERSION); > +MODULE_LICENSE("GPL"); > +MODULE_AUTHOR(DRIVER_AUTHOR); > +MODULE_DESCRIPTION(DRIVER_DESC); > Reviewed-by: Jike Song <jike.s...@intel.com> -- Thanks, Jike

Re: [Qemu-devel] [PATCH v10 03/19] vfio: Rearrange functions to get vfio_group from dev

2016-11-02 Thread Jike Song
vfio_device *device; > > - iommu_group = iommu_group_get(dev); > - if (!iommu_group) > - return NULL; > - > - group = vfio_group_get_from_iommu(iommu_group); > - iommu_group_put(iommu_group); > + group = vfio_group_get_from_dev(dev); > if (!group) > return NULL; > Reviewed-by: Jike Song <jike.s...@intel.com> -- Thanks, Jike

Re: [Qemu-devel] [PATCH v10 01/19] vfio: Mediated device Core driver

2016-11-02 Thread Jike Song
On 11/02/2016 03:59 PM, Kirti Wankhede wrote: > On 10/29/2016 11:41 PM, Jike Song wrote: >> On 10/29/2016 06:06 PM, Kirti Wankhede wrote: >>> >>> >>> On 10/29/2016 10:00 AM, Jike Song wrote: >>>> On 10/27/2016 05:29 AM, Kirti Wankhede wrote: &g

Re: [Qemu-devel] [PATCH v10 00/19] Add Mediated device support

2016-11-01 Thread Jike Song
On 11/01/2016 11:24 PM, Gerd Hoffmann wrote: >> I rebased KVMGT upon v10, with 2 minor changes: >> >> 1, get_user_pages_remote has only 7 args > > Appears to be a 4.9 merge window change. v10 as-is applies and builds > fine against 4.8, after rebasing to 4.9-rc3 it stops building due to >

Re: [Qemu-devel] [PATCH v10 00/19] Add Mediated device support

2016-11-01 Thread Jike Song
On 10/27/2016 05:29 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

Re: [Qemu-devel] [PATCH v10 05/19] vfio iommu: Added pin and unpin callback functions to vfio_iommu_driver_ops

2016-11-01 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > Added two new callback functions to struct vfio_iommu_driver_ops. Backend > IOMMU module that supports pining and unpinning pages for mdev devices > should provide these functions. > Added APIs for pining and unpining pages to VFIO module. These

Re: [Qemu-devel] [PATCH v10 01/19] vfio: Mediated device Core driver

2016-10-31 Thread Jike Song
On 11/01/2016 11:44 AM, Alex Williamson wrote: > On Tue, 01 Nov 2016 11:08:15 +0800 > Jike Song <jike.s...@intel.com> wrote: >> On 10/27/2016 05:29 AM, Kirti Wankhede wrote: >>> +static int mdev_attach_iommu(struct mdev_device *mdev) >>> +{ >>> +

Re: [Qemu-devel] [PATCH v10 01/19] vfio: Mediated device Core driver

2016-10-31 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > Design for Mediated Device Driver: > Main purpose of this driver is to provide a common interface for mediated > device management that can be used by different drivers of different > devices. > > This module provides a generic interface to create

Re: [Qemu-devel] [PATCH v10 18/19] docs: Sysfs ABI for mediated device framework

2016-10-31 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > Added details of sysfs ABI for mediated device framework > > Signed-off-by: Kirti Wankhede > Signed-off-by: Neo Jia > Change-Id: Icb0fd4ed58a2fa793fbcb1c3d5009a4403c1f3ac > --- >

Re: [Qemu-devel] [PATCH v10 10/19] vfio iommu: Add blocking notifier to notify DMA_UNMAP

2016-10-31 Thread Jike Song
On 10/31/2016 01:59 PM, Kirti Wankhede wrote: > On 10/31/2016 9:20 AM, Jike Song wrote: >> On 10/27/2016 05:29 AM, Kirti Wankhede wrote: >>> Added blocking notifier to IOMMU TYPE1 driver to notify vendor drivers >>> about DMA_UNMAP. >>> Expo

Re: [Qemu-devel] [PATCH v10 10/19] vfio iommu: Add blocking notifier to notify DMA_UNMAP

2016-10-30 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > Added blocking notifier to IOMMU TYPE1 driver to notify vendor drivers > about DMA_UNMAP. > Exported two APIs vfio_register_notifier() and vfio_unregister_notifier(). > Vendor driver should register notifer using these APIs. > Vendor driver should

Re: [Qemu-devel] [PATCH v10 01/19] vfio: Mediated device Core driver

2016-10-29 Thread Jike Song
On 10/29/2016 06:06 PM, Kirti Wankhede wrote: > > > On 10/29/2016 10:00 AM, Jike Song wrote: >> On 10/27/2016 05:29 AM, Kirti Wankhede wrote: >>> +int mdev_register_device(struct device *dev, const struct parent_ops *ops) >>> +{ >>> + int

Re: [Qemu-devel] [PATCH v10 01/19] vfio: Mediated device Core driver

2016-10-28 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > +int mdev_register_device(struct device *dev, const struct parent_ops *ops) > +{ > + int ret; > + struct parent_device *parent; > + > + /* check for mandatory ops */ > + if (!ops || !ops->create || !ops->remove ||

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-28 Thread Jike Song
On 10/26/2016 10:45 PM, Paolo Bonzini wrote: > On 26/10/2016 15:44, Jike Song wrote: >> On 10/21/2016 01:06 AM, Paolo Bonzini wrote: >>> On 20/10/2016 03:48, Xiao Guangrong wrote: >>>> I understood that KVM side is safe, however, vfio side is independent with >&g

Re: [Qemu-devel] [PATCH v10 10/19] vfio iommu: Add blocking notifier to notify DMA_UNMAP

2016-10-28 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > Added blocking notifier to IOMMU TYPE1 driver to notify vendor drivers > about DMA_UNMAP. > Exported two APIs vfio_register_notifier() and vfio_unregister_notifier(). > Vendor driver should register notifer using these APIs. > Vendor driver should

Re: [Qemu-devel] [PATCH v10 07/19] vfio iommu type1: Update argument of vaddr_get_pfn()

2016-10-28 Thread Jike Song
On 10/27/2016 08:24 PM, Kirti Wankhede wrote: > > > On 10/27/2016 5:41 PM, Jike Song wrote: >> On 10/27/2016 05:29 AM, Kirti Wankhede wrote: >>> Update arguments of vaddr_get_pfn() to take struct mm_struct *mm as input >>> argument. >>> >>>

Re: [Qemu-devel] [PATCH v10 07/19] vfio iommu type1: Update argument of vaddr_get_pfn()

2016-10-27 Thread Jike Song
On 10/27/2016 05:29 AM, Kirti Wankhede wrote: > Update arguments of vaddr_get_pfn() to take struct mm_struct *mm as input > argument. > > Signed-off-by: Kirti Wankhede > Signed-off-by: Neo Jia > Change-Id: I885fd4cd4a9f66f4ee2c1caf58267464ec239f52 > --- >

Re: [Qemu-devel] [PATCH v9 01/12] vfio: Mediated device Core driver

2016-10-27 Thread Jike Song
On 10/21/2016 01:12 AM, Alex Williamson wrote: > On Thu, 20 Oct 2016 15:23:53 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 10/18/2016 05:22 AM, Kirti Wankhede wrote: >>> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c >

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-26 Thread Jike Song
On 10/21/2016 01:06 AM, Paolo Bonzini wrote: > On 20/10/2016 03:48, Xiao Guangrong wrote: >> I understood that KVM side is safe, however, vfio side is independent with >> kvm and the user of usrdata can fetch kvm struct at any time, consider >> this scenario: >> >> CPU 0

Re: [Qemu-devel] [PATCH v9 00/12] Add Mediated device support

2016-10-24 Thread Jike Song
On 10/18/2016 05:22 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

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-24 Thread Jike Song
On 10/19/2016 09:56 PM, Eric Blake wrote: > 17 levels of quoting is rather over-the-top. It is OKAY (and in fact > DESIRABLE) to trim your emails to relevant portions, when posting to a > high-volume list. Readers shouldn't have to scroll through pages of > deeply-nested quoting... Hi Eric,

Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated devices

2016-10-21 Thread Jike Song
On 10/18/2016 05:22 AM, Kirti Wankhede wrote: > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c > index 2ba19424e4a1..5d67058a611d 100644 > --- a/drivers/vfio/vfio_iommu_type1.c > +++ b/drivers/vfio/vfio_iommu_type1.c [snip] > static int

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-20 Thread Jike Song
On 10/21/2016 01:19 AM, Xiao, Guangrong wrote: >> On 10/19/2016 10:14 PM, Paolo Bonzini wrote: >>> On 19/10/2016 15:39, Xiao Guangrong wrote: >>> >>> >>> I understood that KVM side is safe, however, vfio side is independent >>> with kvm and the user of usrdata can fetch kvm struct at any time,

Re: [Qemu-devel] [PATCH v9 01/12] vfio: Mediated device Core driver

2016-10-20 Thread Jike Song
On 10/21/2016 01:12 AM, Alex Williamson wrote: > On Thu, 20 Oct 2016 15:23:53 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 10/18/2016 05:22 AM, Kirti Wankhede wrote: >>> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c >

Re: [Qemu-devel] [PATCH v9 01/12] vfio: Mediated device Core driver

2016-10-20 Thread Jike Song
On 10/18/2016 05:22 AM, Kirti Wankhede wrote: > diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c > new file mode 100644 > index ..7db5ec164aeb > --- /dev/null > +++ b/drivers/vfio/mdev/mdev_core.c > @@ -0,0 +1,372 @@ > +/* > + * Mediated device Core Driver > +

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-18 Thread Jike Song
On 10/18/2016 10:59 PM, Alex Williamson wrote: > On Tue, 18 Oct 2016 20:38:21 +0800 > Jike Song <jike.s...@intel.com> wrote: >> On 10/18/2016 12:02 AM, Alex Williamson wrote: >>> On Fri, 14 Oct 2016 15:19:01 -0700 >>> Neo Jia <c...@nvidia.com> wrote: >

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-18 Thread Jike Song
m> wrote: >>> >>>> On Fri, Oct 14, 2016 at 08:46:01AM -0600, Alex Williamson wrote: >>>>> On Fri, 14 Oct 2016 08:41:58 -0600 >>>>> Alex Williamson <alex.william...@redhat.com> wrote: >>>>> >>>>>

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-14 Thread Jike Song
On 10/14/2016 06:43 PM, Paolo Bonzini wrote: > > > On 14/10/2016 12:37, Jike Song wrote: >> Hi Paolo & Alex, >> >> IIUC, passing file descriptors means touching QEMU and the UAPI between >> QEMU and VFIO. Would you guys have a look at below draft patch? If i

Re: [Qemu-devel] [PATCH 1/2] KVM: page track: add a new notifier type: track_flush_slot

2016-10-14 Thread Jike Song
On 10/11/2016 05:47 PM, Paolo Bonzini wrote: > > > On 11/10/2016 11:21, Xiao Guangrong wrote: >> >> >> On 10/11/2016 04:54 PM, Paolo Bonzini wrote: >>> >>> >>> On 11/10/2016 04:39, Xiao Guangrong wrote: On 10/11/2016 02:32 AM, Paolo Bonzini wrote: > > > On 10/10/2016

Re: [Qemu-devel] [PATCH v8 4/6] docs: Add Documentation for Mediated devices

2016-10-13 Thread Jike Song
On 10/11/2016 04:28 AM, Kirti Wankhede wrote: > + > +Under per-physical device sysfs: > + > + > +* mdev_supported_types: > +List of current supported mediated device types and its details are added > +in this directory in following format: > + > +|- > +|---

Re: [Qemu-devel] [PATCH v8 0/6] Add Mediated device support

2016-10-10 Thread Jike Song
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

Re: [Qemu-devel] [PATCH v7 3/4] vfio iommu: Add support for mediated devices

2016-10-08 Thread Jike Song
On 09/30/2016 07:44 PM, Kirti Wankhede wrote: > On 9/30/2016 8:40 AM, Jike Song wrote: >> On 09/30/2016 10:58 AM, Jike Song wrote: >>> On 09/29/2016 11:06 PM, Kirti Wankhede wrote: >>>> >>>> >>>> On 9/29/2016 7:47 AM, Jike Song wrote: >

Re: [Qemu-devel] [PATCH v7 3/4] vfio iommu: Add support for mediated devices

2016-09-29 Thread Jike Song
On 09/30/2016 10:58 AM, Jike Song wrote: > On 09/29/2016 11:06 PM, Kirti Wankhede wrote: >> >> >> On 9/29/2016 7:47 AM, Jike Song wrote: >>> +Guangrong >>> >>> On 08/25/2016 11:53 AM, Kirti Wankhede wrote: >> >> ... >

Re: [Qemu-devel] [PATCH v7 3/4] vfio iommu: Add support for mediated devices

2016-09-29 Thread Jike Song
On 09/29/2016 11:06 PM, Kirti Wankhede wrote: > > > On 9/29/2016 7:47 AM, Jike Song wrote: >> +Guangrong >> >> On 08/25/2016 11:53 AM, Kirti Wankhede wrote: > > ... > >>> +static long vfio_iommu_type1_pin_pages(void *iommu_data, >>> +

Re: [Qemu-devel] summary of current vfio mdev upstreaming status

2016-09-29 Thread Jike Song
On 09/29/2016 06:58 PM, Kirti Wankhede wrote: > > > On 9/29/2016 2:47 PM, Neo Jia wrote: >> On Thu, Sep 29, 2016 at 04:55:39PM +0800, Jike Song wrote: >>> Hi all, >>> >>> In order to have a clear understanding about the VFIO mdev upstreaming >>

[Qemu-devel] summary of current vfio mdev upstreaming status

2016-09-29 Thread Jike Song
Hi all, In order to have a clear understanding about the VFIO mdev upstreaming status, I'd like to summarize it. Please share your opinions on this, and correct my misunderstandings. The whole vfio mdev series can be logically divided into several parts, they work together to provide the mdev

Re: [Qemu-devel] [PATCH v7 3/4] vfio iommu: Add support for mediated devices

2016-09-28 Thread Jike Song
+Guangrong On 08/25/2016 11:53 AM, Kirti Wankhede wrote: > VFIO IOMMU drivers are designed for the devices which are IOMMU capable. > Mediated device only uses IOMMU APIs, the underlying hardware can be > managed by an IOMMU domain. > > Aim of this change is: > - To use most of the code of TYPE1

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-20 Thread Jike Song
On 09/21/2016 12:51 PM, Alex Williamson wrote: > On Wed, 21 Sep 2016 11:19:17 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 09/21/2016 12:24 AM, Alex Williamson wrote: >>> On Tue, 20 Sep 2016 10:50:47 +0800 >>> Jike Song <jike.s...@intel.

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-20 Thread Jike Song
On 09/21/2016 12:24 AM, Alex Williamson wrote: > On Tue, 20 Sep 2016 10:50:47 +0800 > Jike Song <jike.s...@intel.com> wrote: /* trim the quotations */ >> Even performing a lightweight sanity check, would require vfio-mdev >> to be able to decode the ppos into a parti

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-20 Thread Jike Song
a <c...@nvidia.com> *Kirti Wankhede <kwankh...@nvidia.com> * + * Copyright (c) 2016 Intel Corporation. + * Author: + * Xiao Guangrong <guangrong.x...@linux.intel.com> + * Jike Song <jike.s...@intel.com> + * * This program is free software; you can redistribu

Re: [Qemu-devel] [PATCH v7 1/4] vfio: Mediated device Core driver

2016-09-20 Thread Jike Song
tion. + * Author: + * Xiao Guangrong <guangrong.x...@linux.intel.com> + * Jike Song <jike.s...@intel.com> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free So

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-20 Thread Jike Song
On 09/20/2016 01:48 PM, Dong Jia Shi wrote: > * Jike Song <jike.s...@intel.com> [2016-09-13 10:35:11 +0800]: > >> On 09/08/2016 10:45 AM, Jike Song wrote: >>> On 08/25/2016 05:22 PM, Dong Jia wrote: >>>> On Thu, 25 Aug 2016 09:23:53 +0530 >>&

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-19 Thread Jike Song
On 09/20/2016 04:03 AM, Alex Williamson wrote: > On Tue, 20 Sep 2016 00:43:15 +0530 > Kirti Wankhede wrote: > >> On 9/20/2016 12:06 AM, Alex Williamson wrote: >>> On Mon, 19 Sep 2016 23:52:36 +0530 >>> Kirti Wankhede wrote: >>> On 8/26/2016

Re: [Qemu-devel] [PATCH v7 1/4] vfio: Mediated device Core driver

2016-09-19 Thread Jike Song
On 09/12/2016 11:53 PM, Alex Williamson wrote: > On Mon, 12 Sep 2016 13:19:11 +0530 > Kirti Wankhede <kwankh...@nvidia.com> wrote: > >> On 9/12/2016 10:40 AM, Jike Song wrote: >>> On 09/10/2016 03:55 AM, Kirti Wankhede wrote: >>>> On 9/10/2016 12:12 AM

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-12 Thread Jike Song
On 09/08/2016 10:45 AM, Jike Song wrote: > On 08/25/2016 05:22 PM, Dong Jia wrote: >> On Thu, 25 Aug 2016 09:23:53 +0530 >> Kirti Wankhede <kwankh...@nvidia.com> wrote: >> >> [...] >> >> Dear Kirti, >> >> I just rebased my vfio-ccw patche

Re: [Qemu-devel] [PATCH v7 1/4] vfio: Mediated device Core driver

2016-09-11 Thread Jike Song
On 09/10/2016 03:55 AM, Kirti Wankhede wrote: > On 9/10/2016 12:12 AM, Alex Williamson wrote: >> On Fri, 9 Sep 2016 23:18:45 +0530 >> Kirti Wankhede <kwankh...@nvidia.com> wrote: >> >>> On 9/8/2016 1:39 PM, Jike Song wrote: >>>&

Re: [Qemu-devel] [PATCH v7 1/4] vfio: Mediated device Core driver

2016-09-09 Thread Jike Song
On 09/08/2016 05:38 PM, Neo Jia wrote: > On Thu, Sep 08, 2016 at 04:09:39PM +0800, Jike Song wrote: >> On 08/25/2016 11:53 AM, Kirti Wankhede wrote: >>> + >>> +/** >>> + * struct parent_ops - Structure to be registered for each parent device to >&g

Re: [Qemu-devel] [PATCH v7 1/4] vfio: Mediated device Core driver

2016-09-08 Thread Jike Song
On 08/25/2016 11:53 AM, Kirti Wankhede wrote: > Design for Mediated Device Driver: > Main purpose of this driver is to provide a common interface for mediated > device management that can be used by different drivers of different > devices. > > This module provides a generic interface to create

Re: [Qemu-devel] [RFC v2 0/4] adding mdev bus and vfio support

2016-09-08 Thread Jike Song
On 09/08/2016 12:56 AM, Alex Williamson wrote: > On Wed, 07 Sep 2016 14:42:58 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 09/07/2016 11:38 AM, Neo Jia wrote: >>> On Wed, Sep 07, 2016 at 10:22:26AM +0800, Jike Song wrote: >>>> On

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-07 Thread Jike Song
On 08/25/2016 05:22 PM, Dong Jia wrote: > On Thu, 25 Aug 2016 09:23:53 +0530 > Kirti Wankhede wrote: > > [...] > > Dear Kirti, > > I just rebased my vfio-ccw patches to this series. > With a little fix, which was pointed it out in my reply to the #3 > patch, it works

Re: [Qemu-devel] [PATCH v7 2/4] vfio: VFIO driver for mediated devices

2016-09-07 Thread Jike Song
On 08/26/2016 10:13 PM, Kirti Wankhede wrote: > > > On 8/25/2016 2:52 PM, Dong Jia wrote: >> On Thu, 25 Aug 2016 09:23:53 +0530 >> Kirti Wankhede wrote: >> >> [...] >> >> Dear Kirti, >> >> I just rebased my vfio-ccw patches to this series. >> With a little fix, which was

Re: [Qemu-devel] [RFC v2 0/4] adding mdev bus and vfio support

2016-09-07 Thread Jike Song
On 09/07/2016 11:38 AM, Neo Jia wrote: > On Wed, Sep 07, 2016 at 10:22:26AM +0800, Jike Song wrote: >> On 09/02/2016 11:03 PM, Alex Williamson wrote: >>> On Fri, 2 Sep 2016 16:16:08 +0800 >>> Jike Song <jike.s...@intel.com> wrote: >>> >>>> T

Re: [Qemu-devel] [RFC v2 0/4] adding mdev bus and vfio support

2016-09-06 Thread Jike Song
On 09/02/2016 11:03 PM, Alex Williamson wrote: > On Fri, 2 Sep 2016 16:16:08 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> This patchset is based on NVidia's "Add Mediated device support" series, >> version 6: >> >> http://www.spi

[Qemu-devel] [RFC v2 4/4] docs: Add Documentation for Mediated devices

2016-09-02 Thread Jike Song
From: Kirti Wankhede <kwankh...@nvidia.com> Add file Documentation/vfio-mediated-device.txt that include details of mediated device framework. Signed-off-by: Kirti Wankhede <kwankh...@nvidia.com> Signed-off-by: Neo Jia <c...@nvidia.com> Signed-off-by: Jike Song &l

[Qemu-devel] [RFC v2 3/4] vfio iommu: Add support for mediated devices

2016-09-02 Thread Jike Song
- two GPU pass through Signed-off-by: Kirti Wankhede <kwankh...@nvidia.com> Signed-off-by: Neo Jia <c...@nvidia.com> Change-Id: I295d6f0f2e0579b8d9882bfd8fd5a4194b97bd9a Signed-off-by: Jike Song <jike.s...@intel.com> --- drivers/vfio/vfio.c | 82 +++ drivers

[Qemu-devel] [RFC v2 1/4] Mediated device Core driver

2016-09-02 Thread Jike Song
igned-off-by: Xiao Guangrong <guangrong.x...@linux.intel.com> Signed-off-by: Jike Song <jike.s...@intel.com> --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile| 1 + drivers/vfio/mdev/Kconfig| 10 ++ drivers/

[Qemu-devel] [RFC v2 0/4] adding mdev bus and vfio support

2016-09-02 Thread Jike Song
ove common routines from current vfio-pci into a higher location, export them for various VFIO bus drivers and/or mdev vendor drivers; - Add implementation examples for vendor drivers to Documentation; - Refine IOMMU changes Jike Song (2): Mediated device Core driver

[Qemu-devel] [RFC v2 2/4] vfio: VFIO bus driver for MDEV devices

2016-09-02 Thread Jike Song
APIs for each mediated PCI device. See Documentation/vfio-mediated-device.txt for details. Signed-off-by: Kirti Wankhede <kwankh...@nvidia.com> Signed-off-by: Neo Jia <c...@nvidia.com> Signed-off-by: Xiao Guangrong <guangrong.x...@linux.intel.com> Signed-off-by: Jike Song &l

Re: [Qemu-devel] [PATCH v7 0/4] Add Mediated device support

2016-08-31 Thread Jike Song
On 08/31/2016 02:12 PM, Tian, Kevin wrote: >> From: Alex Williamson [mailto:alex.william...@redhat.com] >> Sent: Wednesday, August 31, 2016 12:17 AM >> >> Hi folks, >> >> At KVM Forum we had a BoF session primarily around the mediated device >> sysfs interface. I'd like to share what I think we

[Qemu-devel] [RFC v6-based v1 3/5] mdev: remove uuid from parent_ops

2016-08-16 Thread Jike Song
mdev should be able to start/stop separately, not relying on grouping in a VM. And even if grouping start/stop needed, it's always easy for userspace to find out all mdevs belonging to a particular VM. Signed-off-by: Jike Song <jike.s...@intel.com> --- drivers/vfio/mdev/mdev_core

[Qemu-devel] [RFC v6-based v1 2/5] mdev: drop management information and utilize driver-core instead

2016-08-16 Thread Jike Song
From: Xiao Guangrong Now mdev has a separate parent device, so quite a few codes and information used for managing mdev, can be removed. Linux driver core will take care of us. Signed-off-by: Xiao Guangrong ---

[Qemu-devel] [RFC v6-based v1 5/5] rename 'vfio_mpci' to 'vfio_mdev' since it is now BUS-agnostic

2016-08-16 Thread Jike Song
Signed-off-by: Jike Song <jike.s...@intel.com> --- drivers/vfio/mdev/Kconfig | 10 +- drivers/vfio/mdev/Makefile | 5 ++--- drivers/vfio/mdev/{vfio_mpci.c => vfio_mdev.c} | 0 3 files changed, 7 insertions(+), 8 deletions(-) rename dri

[Qemu-devel] [RFC v6-based v1 1/5] mdev: create separate device for parent_device

2016-08-16 Thread Jike Song
From: Xiao Guangrong By introducing a separate device for parent_device, we can have the parent list and lock removed, letting driver core and sysfs to deal with the mutual exclusion. Signed-off-by: Xiao Guangrong ---

[Qemu-devel] [RFC v6-based v1 4/5] vfio_mpci: remove PCI-specific logic

2016-08-16 Thread Jike Song
As a generic mdev driver, 'vfio_mpci' should be BUS-agnostic and as thin as possible, passing through all device operations directly to underlying physical driver(a.k.a the device-model). Signed-off-by: Jike Song <jike.s...@intel.com> --- drivers/vfio/mdev/mdev_core.c

[Qemu-devel] [RFC v6-based v1 0/5] refine mdev framework

2016-08-16 Thread Jike Song
ev stuff from vfio.h update doc Jike Song (3): mdev: remove uuid from parent_ops vfio_mpci: remove PCI-specific logic rename 'vfio_mpci' to 'vfio_mdev' since it is now BUS-agnostic Xiao Guangrong (2): mdev: create separate device for parent_device mdev: drop management informatio

Re: [Qemu-devel] [PATCH 1/3] Mediated device Core driver

2016-07-03 Thread Jike Song
On 06/21/2016 12:31 AM, Kirti Wankhede wrote: > +/* > + * mdev_register_device : Register a device > + * @dev: device structure representing parent device. > + * @ops: Parent device operation structure to be registered. > + * > + * Add device to list of registered parent devices. > + * Returns a

Re: [Qemu-devel] [PATCH 1/3] Mediated device Core driver

2016-06-30 Thread Jike Song
On 06/29/2016 09:51 PM, Xiao Guangrong wrote: > On 06/21/2016 12:31 AM, Kirti Wankhede wrote: >> +mutex_unlock(_devices.list_lock); >> +return parent; >> +} >> + >> +static int mdev_device_create_ops(struct mdev_device *mdev, char >> *mdev_params) >> +{ >> +struct parent_device

Re: [Qemu-devel] [PATCH 1/3] Mediated device Core driver

2016-06-21 Thread Jike Song
On 06/21/2016 12:31 AM, Kirti Wankhede wrote: > + > +static int mdev_add_attribute_group(struct device *dev, > + const struct attribute_group **groups) > +{ > + return sysfs_create_groups(>kobj, groups); > +} > + > +static void mdev_remove_attribute_group(struct

Re: [Qemu-devel] [RFC PATCH v4 0/3] Add Mediated device support[was: Add vGPU support]

2016-06-01 Thread Jike Song
On 05/31/2016 10:29 PM, Alex Williamson wrote: > On Tue, 31 May 2016 10:29:10 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 05/28/2016 10:56 PM, Alex Williamson wrote: >>> On Fri, 27 May 2016 22:43:54 + >>> "Tian, Kevin" <kevin.t

Re: [Qemu-devel] [RFC PATCH v4 0/3] Add Mediated device support[was: Add vGPU support]

2016-05-30 Thread Jike Song
On 05/28/2016 10:56 PM, Alex Williamson wrote: > On Fri, 27 May 2016 22:43:54 + > "Tian, Kevin" wrote: > >> >> My impression was that you don't like hypervisor specific thing in VFIO, >> which makes it a bit tricky to accomplish those tasks in kernel. If we >> can add

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-16 Thread Jike Song
On 05/13/2016 11:50 PM, Neo Jia wrote: > On Fri, May 13, 2016 at 05:23:44PM +0800, Jike Song wrote: >> On 05/13/2016 04:31 PM, Neo Jia wrote: >>> On Fri, May 13, 2016 at 07:45:14AM +, Tian, Kevin wrote: >>>> >>>> We use page tracking frame

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-15 Thread Jike Song
On 05/13/2016 11:48 PM, Neo Jia wrote: > On Fri, May 13, 2016 at 05:46:17PM +0800, Jike Song wrote: >> On 05/13/2016 04:12 AM, Neo Jia wrote: >>> On Thu, May 12, 2016 at 01:05:52PM -0600, Alex Williamson wrote: >>>> >>>> If you're trying to equate

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-13 Thread Jike Song
On 05/13/2016 04:12 AM, Neo Jia wrote: > On Thu, May 12, 2016 at 01:05:52PM -0600, Alex Williamson wrote: >> >> If you're trying to equate the scale of what we need to track vs what >> type1 currently tracks, they're significantly different. Possible >> things we need to track include the pfn,

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-13 Thread Jike Song
On 05/13/2016 04:31 PM, Neo Jia wrote: > On Fri, May 13, 2016 at 07:45:14AM +, Tian, Kevin wrote: >> >> We use page tracking framework, which is newly added to KVM recently, >> to mark RAM pages as read-only so write accesses are intercepted to >> device model. > > Yes, I am aware of that

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-13 Thread Jike Song
On 05/13/2016 02:43 PM, Neo Jia wrote: > On Fri, May 13, 2016 at 02:22:37PM +0800, Jike Song wrote: >> On 05/13/2016 10:41 AM, Tian, Kevin wrote: >>>> From: Neo Jia [mailto:c...@nvidia.com] Sent: Friday, May 13, >>>> 2016 3:49 AM >>>> >>&g

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-13 Thread Jike Song
On 05/13/2016 10:41 AM, Tian, Kevin wrote: >> From: Neo Jia [mailto:c...@nvidia.com] >> Sent: Friday, May 13, 2016 3:49 AM >> >>> Perhaps one possibility would be to allow the vgpu driver to register map and unmap callbacks. The unmap callback might provide the invalidation

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-13 Thread Jike Song
On 05/13/2016 03:49 AM, Neo Jia wrote: > On Thu, May 12, 2016 at 12:11:00PM +0800, Jike Song wrote: >> On Thu, May 12, 2016 at 6:06 AM, Alex Williamson >> <alex.william...@redhat.com> wrote: >>> On Wed, 11 May 2016 17:15:15 +0800 >>> Jike Song <jike.s...@i

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-11 Thread Jike Song
On Thu, May 12, 2016 at 6:06 AM, Alex Williamson <alex.william...@redhat.com> wrote: > On Wed, 11 May 2016 17:15:15 +0800 > Jike Song <jike.s...@intel.com> wrote: > >> On 05/11/2016 12:02 AM, Neo Jia wrote: >> > On Tue, May 10, 2016 at 03:52:27PM +0800, Jike S

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-11 Thread Jike Song
On 05/11/2016 12:02 AM, Neo Jia wrote: > On Tue, May 10, 2016 at 03:52:27PM +0800, Jike Song wrote: >> On 05/05/2016 05:27 PM, Tian, Kevin wrote: >>>> From: Song, Jike >>>> >>>> IIUC, an api-only domain is a VFIO domain *without* underlying IOMMU >&g

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-10 Thread Jike Song
On 05/05/2016 05:27 PM, Tian, Kevin wrote: >> From: Song, Jike >> >> IIUC, an api-only domain is a VFIO domain *without* underlying IOMMU >> hardware. It just, as you said in another mail, "rather than >> programming them into an IOMMU for a device, it simply stores the >> translations for use by

Re: [Qemu-devel] [RFC PATCH v3 1/3] vGPU Core driver

2016-05-09 Thread Jike Song
On 05/07/2016 12:16 AM, Kirti Wankhede wrote: > > > On 5/6/2016 5:44 PM, Jike Song wrote: >> On 05/05/2016 05:06 PM, Tian, Kevin wrote: >>>> From: Kirti Wankhede >>>> >>>> >> + * @validate_map_request: Validate remap pfn request &

Re: [Qemu-devel] [RFC PATCH v3 1/3] vGPU Core driver

2016-05-06 Thread Jike Song
On 05/05/2016 05:06 PM, Tian, Kevin wrote: >> From: Kirti Wankhede >> >> >> + * @validate_map_request: Validate remap pfn request >> >> + * @vdev: vgpu device structure >> >> + * @virtaddr: target user address to start >> at >>

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-05 Thread Jike Song
On 05/04/2016 06:43 AM, Alex Williamson wrote: > On Tue, 3 May 2016 00:10:41 +0530 > Kirti Wankhede wrote: >> + >> +/* >> + * Pin a set of guest PFNs and return their associated host PFNs for vGPU. >> + * @vaddr [in]: array of guest PFNs >> + * @npage [in]: count of array

Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu

2016-05-03 Thread Jike Song
On 05/03/2016 02:40 AM, Kirti Wankhede wrote: > VFIO Type1 IOMMU driver is designed for the devices which are IOMMU capable. > vGPU device are only using IOMMU TYPE1 API, the underlying hardware can be > managed by an IOMMU domain. To use most of the code of IOMMU driver for vGPU > devices, type1

Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU

2016-03-09 Thread Jike Song
On 03/08/2016 08:31 AM, Neo Jia wrote: > On Mon, Mar 07, 2016 at 02:07:15PM +0800, Jike Song wrote: >> Hi Neo, >> >> On Fri, Mar 4, 2016 at 3:00 PM, Neo Jia <c...@nvidia.com> wrote: >>> On Wed, Mar 02, 2016 at 04:38:34PM +0800, Jike Song wrote: >>>&

Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU

2016-03-06 Thread Jike Song
Hi Neo, On Fri, Mar 4, 2016 at 3:00 PM, Neo Jia <c...@nvidia.com> wrote: > On Wed, Mar 02, 2016 at 04:38:34PM +0800, Jike Song wrote: >> On 02/24/2016 12:24 AM, Kirti Wankhede wrote: >> > + vgpu_dma->size = map->size; >> > + >> > + vgpu_link

  1   2   >