[Intel-gfx] [RFC PATCH 2/2] mdev: introduce device specific ops

2019-09-12 Thread Jason Wang
ops). This allows the future drivers like virtio-mdev to implement its own device specific ops. Signed-off-by: Jason Wang --- drivers/gpu/drm/i915/gvt/kvmgt.c | 14 +++--- drivers/s390/cio/vfio_ccw_ops.c | 14 +++--- drivers/s390/crypto/vfio_ap_ops.c | 10 +++-- drivers/vfio/mdev/vfio_mdev.c

[Intel-gfx] [RFC PATCH 1/2] mdev: device id support

2019-09-12 Thread Jason Wang
this patch add id_table to mdev_driver and id for mdev parent, and implement the match method for mdev bus. [1] https://lkml.org/lkml/2019/9/10/135 Signed-off-by: Jason Wang --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- drivers/s390/cio/vfio_ccw_ops.c | 2 +- drivers/s390/crypto/vfio_ap_ops.c

[Intel-gfx] [RFC PATCH 0/2] Mdev: support mutiple kinds of devices

2019-09-12 Thread Jason Wang
and move vfio callbacks there Sent for early reivew, compile test only! Thanks [1] https://lkml.org/lkml/2019/9/10/135 Jason Wang (2): mdev: device id support mdev: introduce device specific ops drivers/gpu/drm/i915/gvt/kvmgt.c | 16 --- drivers/s390/cio/vfio_ccw_ops.c | 16

Re: [Intel-gfx] [RFC PATCH 1/2] mdev: device id support

2019-09-17 Thread Jason Wang
On 2019/9/17 下午3:55, Tian, Kevin wrote: From: Jason Wang Sent: Thursday, September 12, 2019 5:40 PM Mdev bus only support vfio driver right now, so it doesn't implement match method. But in the future, we may add drivers other than vfio, one example is virtio-mdev[1] driver. This means we need

Re: [Intel-gfx] [RFC PATCH 2/2] mdev: introduce device specific ops

2019-09-17 Thread Jason Wang
On 2019/9/17 下午4:09, Tian, Kevin wrote: From: Jason Wang Sent: Thursday, September 12, 2019 5:40 PM Currently, except for the crate and remove. The rest fields of mdev_parent_ops is just designed for vfio-mdev driver and may not help for kernel mdev driver. So follow the device id support

Re: [Intel-gfx] [RFC PATCH 1/2] mdev: device id support

2019-09-17 Thread Jason Wang
On 2019/9/17 下午8:07, Cornelia Huck wrote: On Thu, 12 Sep 2019 17:40:11 +0800 Jason Wang wrote: Mdev bus only support vfio driver right now, so it doesn't implement match method. But in the future, we may add drivers other than vfio, one example is virtio-mdev[1] driver. This means we need

Re: [Intel-gfx] [RFC PATCH 2/2] mdev: introduce device specific ops

2019-09-17 Thread Jason Wang
On 2019/9/17 下午8:42, Cornelia Huck wrote: On Thu, 12 Sep 2019 17:40:12 +0800 Jason Wang wrote: Currently, except for the crate and remove. The rest fields of mdev_parent_ops is just designed for vfio-mdev driver and may not help for kernel mdev driver. So follow the device id support

Re: [Intel-gfx] [RFC PATCH 2/2] mdev: introduce device specific ops

2019-09-18 Thread Jason Wang
On 2019/9/18 上午10:57, Tian, Kevin wrote: From: Jason Wang [mailto:jasow...@redhat.com] Sent: Tuesday, September 17, 2019 6:17 PM On 2019/9/17 下午4:09, Tian, Kevin wrote: From: Jason Wang Sent: Thursday, September 12, 2019 5:40 PM Currently, except for the crate and remove. The rest fields

Re: [Intel-gfx] [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-26 Thread Jason Wang
On 2019/9/26 上午8:48, Tian, Kevin wrote: +}; I'm not sure how stable above ops are. It's the kernel internal API, so there's no strict requirement for this. We will export a version value for userspace for compatibility. Does it make sense if defining just two callbacks here, e.g. vq_ctrl

Re: [Intel-gfx] [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-25 Thread Jason Wang
On 2019/9/25 下午9:21, Michael S. Tsirkin wrote: On Wed, Sep 25, 2019 at 08:45:21PM +0800, Jason Wang wrote: On 2019/9/25 下午5:09, Tian, Kevin wrote: From: Jason Wang [mailto:jasow...@redhat.com] Sent: Tuesday, September 24, 2019 9:54 PM This patch implements basic support for mdev driver

Re: [Intel-gfx] [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-26 Thread Jason Wang
On 2019/9/26 下午4:21, Michael S. Tsirkin wrote: On Thu, Sep 26, 2019 at 12:04:46PM +0800, Jason Wang wrote: I'm not sure how stable above ops are. It's the kernel internal API, so there's no strict requirement for this. We will export a version value for userspace for compatibility. Given

Re: [Intel-gfx] [PATCH V2 5/8] mdev: introduce device specific ops

2019-09-27 Thread Jason Wang
On 2019/9/25 下午10:11, Rob Miller wrote: > >     mdev_set_class_id(mdev, MDEV_ID_VFIO); > > +   mdev_set_dev_ops(mdev, _vfio_vgpu_dev_ops); > > This seems rather unrefined.  We're registering interdependent data in > separate calls.  All drivers need to make both of these calls.  I'm not > sure

Re: [Intel-gfx] [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-27 Thread Jason Wang
On 2019/9/25 上午7:06, Alex Williamson wrote: On Tue, 24 Sep 2019 21:53:30 +0800 Jason Wang wrote: This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- include/linux/mdev.h| 2 + include/linux

Re: [Intel-gfx] [PATCH 1/6] mdev: class id support

2019-09-24 Thread Jason Wang
On 2019/9/24 上午12:05, Alex Williamson wrote: > On Mon, 23 Sep 2019 21:03:26 +0800 > Jason Wang wrote: > >> Mdev bus only supports vfio driver right now, so it doesn't implement >> match method. But in the future, we may add drivers other than vfio, >> one examp

Re: [Intel-gfx] [PATCH 2/6] mdev: introduce device specific ops

2019-09-24 Thread Jason Wang
-20190920] >> [if your patch is applied to the wrong git tree, please drop us a note to >> help >> improve the system. BTW, we also suggest to use '--base' option to specify >> the >> base tree in git format-patch, please see >> https://stackoverflow.com/a/3740

Re: [Intel-gfx] [PATCH 1/6] mdev: class id support

2019-09-24 Thread Jason Wang
On 2019/9/24 上午5:02, Parav Pandit wrote: > Hi Jason, > > >> -Original Message- >> From: Jason Wang >> Sent: Monday, September 23, 2019 8:03 AM >> To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- >> ker...@vger.kernel.org; dri-d

Re: [Intel-gfx] [PATCH 2/6] mdev: introduce device specific ops

2019-09-24 Thread Jason Wang
On 2019/9/24 上午6:59, Parav Pandit wrote: > >> -Original Message- >> From: Jason Wang >> Sent: Monday, September 23, 2019 8:03 AM >> To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- >> ker...@vger.kernel.org; dri-de...@l

[Intel-gfx] [PATCH V2 8/8] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-09-24 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 7 + samples/vfio-mdev/Makefile | 1 + samples/vfio-mdev

[Intel-gfx] [PATCH V2 7/8] virtio: introduce a mdev based transport

2019-09-24 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through device specific opswhich is a part of mdev_parent_ops now. Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 7 + drivers/virtio

[Intel-gfx] [PATCH V2 0/8] mdev based hardware virtio offloading support

2019-09-24 Thread Jason Wang
(device_ops) - split device_ops into seperate headers - drop the mdev_set_dma_ops() - use device_ops to implement the transport API, then it's not a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (8)

[Intel-gfx] [PATCH V2 2/8] mdev: class id support

2019-09-24 Thread Jason Wang
. So this patch adds id_table to mdev_driver and class_id for mdev parent with the match method for mdev bus. Signed-off-by: Jason Wang --- Documentation/driver-api/vfio-mediated-device.rst | 3 +++ drivers/gpu/drm/i915/gvt/kvmgt.c | 1 + drivers/s390/cio/vfio_ccw_ops.c

[Intel-gfx] [PATCH V2 3/8] mdev: bus uevent support

2019-09-24 Thread Jason Wang
This patch adds bus uevent support for mdev bus in order to allow cooperation with userspace. Signed-off-by: Jason Wang --- drivers/vfio/mdev/mdev_driver.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c index

[Intel-gfx] [PATCH V2 1/8] vringh: fix copy direction of vringh_iov_push_kern()

2019-09-24 Thread Jason Wang
We want to copy from iov to buf, so the direction was wrong. Signed-off-by: Jason Wang --- drivers/vhost/vringh.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 08ad0d1f0476..a0a2d74967ef 100644 --- a/drivers

Re: [Intel-gfx] [PATCH 1/6] mdev: class id support

2019-09-24 Thread Jason Wang
On 2019/9/24 上午4:58, Parav Pandit wrote: > Hi Jason, > >> -Original Message----- >> From: Jason Wang >> Sent: Monday, September 23, 2019 8:03 AM >> To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- >> ker...@vger.kernel.org; dri-de..

Re: [Intel-gfx] [PATCH 4/6] virtio: introduce a mdev based transport

2019-09-24 Thread Jason Wang
On 2019/9/24 上午6:28, Parav Pandit wrote: > >> -Original Message- >> From: Jason Wang >> Sent: Monday, September 23, 2019 8:03 AM >> To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- >> ker...@vger.kernel.org; dri-de...@l

[Intel-gfx] [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-24 Thread Jason Wang
This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- include/linux/mdev.h| 2 + include/linux/virtio_mdev.h | 145 2 files changed, 147 insertions(+) create mode

[Intel-gfx] [PATCH V2 5/8] mdev: introduce device specific ops

2019-09-24 Thread Jason Wang
to be used by vfio-mdev and virtio-mdev. Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 4 +- MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c | 17 +++--- drivers/s390/cio/vfio_ccw_ops.c | 17

[Intel-gfx] [PATCH V2 4/8] modpost: add support for mdev class id

2019-09-24 Thread Jason Wang
Add support to parse mdev class id table. Signed-off-by: Jason Wang --- drivers/vfio/mdev/vfio_mdev.c | 2 ++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 10 ++ 3 files changed, 15 insertions(+) diff --git a/drivers/vfio/mdev/vfio_mdev.c b

[Intel-gfx] [RFC PATCH V2 1/6] mdev: class id support

2019-09-20 Thread Jason Wang
. So this patch add id_table to mdev_driver and id for mdev parent, and implement the match method for mdev bus. Signed-off-by: Jason Wang --- Documentation/driver-api/vfio-mediated-device.rst | 7 +-- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- drivers/s390/cio/vfio_ccw_ops.c

[Intel-gfx] [RFC PATCH V2 2/6] mdev: introduce device specific ops

2019-09-20 Thread Jason Wang
ops). This allows the future drivers like virtio-mdev to implement its own device specific ops. Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 4 +- drivers/gpu/drm/i915/gvt/kvmgt.c | 15 +++--- drivers/s390/cio/vfio_ccw_ops.c | 15

[Intel-gfx] [RFC PATCH V2 0/6] mdev based hardware virtio offloading support

2019-09-20 Thread Jason Wang
of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: class id support mdev: introduce device specific ops mdev: introduce virtio device and its device ops virtio: introudce a mdev based

[Intel-gfx] [RFC PATCH V2 4/6] virtio: introudce a mdev based transport

2019-09-20 Thread Jason Wang
the device with mdev based config ops. This means, unlike the exist hardware transport, this is a software transport between mdev driver and mdev device. The transport was implemented through device specific ops which is a part of mdev_parent_ops now. Signed-off-by: Jason Wang --- drivers/vfio/mdev

[Intel-gfx] [RFC PATCH V2 3/6] mdev: introduce virtio device and its device ops

2019-09-20 Thread Jason Wang
This patch implements basic support for mdev driver that support virtio transport for kernel driver. Signed-off-by: Jason Wang --- drivers/vfio/mdev/mdev_core.c | 7 ++ include/linux/mdev.h | 3 + include/linux/virtio_mdev.h | 141 ++ 3 files

[Intel-gfx] [RFC PATCH V2 6/6] docs: Sample driver to demonstrate how to implement virtio-mdev framework

2019-09-20 Thread Jason Wang
. No more work for userspace VFIO based vhost-mdev driver to work. E.g through notifier, it will be addressed in the future. Signed-off-by: Jason Wang --- samples/Kconfig| 7 + samples/vfio-mdev/Makefile | 1 + samples/vfio-mdev/mvnet.c | 688 + 3

[Intel-gfx] [RFC PATCH V2 5/6] vringh: fix copy direction of vringh_iov_push_kern()

2019-09-20 Thread Jason Wang
We want to copy from iov to buf, so the direction was wrong. Signed-off-by: Jason Wang --- drivers/vhost/vringh.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 08ad0d1f0476..a0a2d74967ef 100644 --- a/drivers

[Intel-gfx] [PATCH V6 0/6] mdev based hardware virtio offloading support

2019-10-30 Thread Jason Wang
nd device specific ops (device_ops) - split device_ops into seperate headers - drop the mdev_set_dma_ops() - use device_ops to implement the transport API, then it's not a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet dev

[Intel-gfx] [PATCH V6 5/6] virtio: introduce a mdev based transport

2019-10-30 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through device specific ops which is a part of mdev_parent_ops now. Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 7 + drivers/virtio

[Intel-gfx] [PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-10-30 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 7 + samples/vfio-mdev/Makefile | 1 + samples/vfio-mdev

[Intel-gfx] [PATCH V6 4/6] mdev: introduce virtio device and its device ops

2019-10-30 Thread Jason Wang
This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- drivers/vfio/mdev/mdev_core.c| 20 drivers/vfio/mdev/mdev_private.h | 2 + include/linux/mdev.h | 6 ++ include/linux

[Intel-gfx] [PATCH V6 1/6] mdev: class id support

2019-10-30 Thread Jason Wang
. So this patch adds id_table to mdev_driver and class_id for mdev device with the match method for mdev bus. Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 5 drivers/gpu/drm/i915/gvt/kvmgt.c | 1 + drivers/s390/cio/vfio_ccw_ops.c

[Intel-gfx] [PATCH V6 2/6] modpost: add support for mdev class id

2019-10-30 Thread Jason Wang
Add support to parse mdev class id table. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- drivers/vfio/mdev/vfio_mdev.c | 2 ++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 11 +++ 3 files changed, 16 insertions(+) diff --git a/drivers

[Intel-gfx] [PATCH V6 3/6] mdev: introduce device specific ops

2019-10-30 Thread Jason Wang
to be used by vfio-mdev and virtio-mdev. Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 35 + MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c | 18 --- drivers/s390/cio/vfio_ccw_ops.c

Re: [Intel-gfx] [PATCH V7 1/6] mdev: class id support

2019-11-04 Thread Jason Wang
On 2019/11/5 上午5:50, Alex Williamson wrote: On Mon, 4 Nov 2019 20:39:47 +0800 Jason Wang wrote: Mdev bus only supports vfio driver right now, so it doesn't implement match method. But in the future, we may add drivers other than vfio, the first driver could be virtio-mdev. This means we

Re: [Intel-gfx] [PATCH V7 3/6] mdev: introduce device specific ops

2019-11-04 Thread Jason Wang
On 2019/11/5 上午5:50, Alex Williamson wrote: EXPORT_SYMBOL(mdev_set_drvdata); + Extra whitespace /* Specify the class for the mdev device, this must be called during - * create() callback. - */ + * create() callback explicitly or implicity through the helpers s/implicity/implicitly/

Re: [Intel-gfx] [PATCH V7 4/6] mdev: introduce virtio device and its device ops

2019-11-04 Thread Jason Wang
On 2019/11/5 上午5:50, Alex Williamson wrote: On Mon, 4 Nov 2019 20:39:50 +0800 Jason Wang wrote: This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- drivers/vfio/mdev/mdev_core.c| 20

Re: [Intel-gfx] [PATCH V7 4/6] mdev: introduce virtio device and its device ops

2019-11-04 Thread Jason Wang
On 2019/11/5 下午12:39, Alex Williamson wrote: On Tue, 5 Nov 2019 11:52:41 +0800 Jason Wang wrote: On 2019/11/5 上午5:50, Alex Williamson wrote: On Mon, 4 Nov 2019 20:39:50 +0800 Jason Wang wrote: This patch implements basic support for mdev driver that supports virtio transport

Re: [Intel-gfx] [PATCH V8 4/6] mdev: introduce virtio device and its device ops

2019-11-05 Thread Jason Wang
On 2019/11/6 上午1:47, Alex Williamson wrote: +#define VIRTIO_MDEV_DEVICE_API_STRING "virtio-mdev" +#define VIRTIO_MDEV_F_VERSION_1 0x1 This entire concept of VIRTIO_MDEV_F_VERSION_1 is gone now, right? Let's remove it here and below. Thanks, Alex Yes, will fix. Thanks

Re: [Intel-gfx] [PATCH V8 3/6] mdev: introduce device specific ops

2019-11-05 Thread Jason Wang
On 2019/11/6 上午2:28, Cornelia Huck wrote: On Tue, 5 Nov 2019 10:44:18 -0700 Alex Williamson wrote: On Tue, 5 Nov 2019 17:50:25 +0100 Cornelia Huck wrote: On Tue, 5 Nov 2019 17:32:37 +0800 Jason Wang wrote: Currently, except for the create and remove, the rest of mdev_parent_ops

Re: [Intel-gfx] [PATCH V8 0/6] mdev based hardware virtio offloading support

2019-11-05 Thread Jason Wang
On 2019/11/6 上午1:58, Alex Williamson wrote: On Tue, 5 Nov 2019 17:32:34 +0800 Jason Wang wrote: Hi all: There are hardwares that can do virtio datapath offloading while having its own control path. This path tries to implement a mdev based unified API to support using kernel virtio driver

[Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-06 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Acked-by: Cornelia Huck Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 10 + samples/vfio-mdev/Makefile

[Intel-gfx] [PATCH V10 5/6] virtio: introduce a mdev based transport

2019-11-06 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through virtio device specific ops. Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 13 ++ drivers/virtio/Makefile

[Intel-gfx] [PATCH V10 4/6] mdev: introduce virtio device and its device ops

2019-11-06 Thread Jason Wang
This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- MAINTAINERS | 1 + drivers/vfio/mdev/mdev_core.c| 21 + drivers/vfio/mdev/mdev_private.h | 2

[Intel-gfx] [PATCH V10 3/6] mdev: introduce device specific ops

2019-11-06 Thread Jason Wang
to be used by vfio-mdev and virtio-mdev. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 35 + MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c | 18 --- drivers/s390/cio

Re: [Intel-gfx] [PATCH V9 5/6] virtio: introduce a mdev based transport

2019-11-06 Thread Jason Wang
On 2019/11/6 下午7:00, Cornelia Huck wrote: On Wed, 6 Nov 2019 15:05:47 +0800 Jason Wang wrote: This patch introduces a new mdev transport for virtio. This is used to use kernel virtio driver to drive the mediated device that is capable of populating virtqueue directly. A new virtio-mdev

[Intel-gfx] [PATCH V10 0/6] mdev based hardware virtio offloading support

2019-11-06 Thread Jason Wang
e_ops into seperate headers - drop the mdev_set_dma_ops() - use device_ops to implement the transport API, then it's not a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: class id support m

[Intel-gfx] [PATCH V10 1/6] mdev: class id support

2019-11-06 Thread Jason Wang
. So this patch adds id_table to mdev_driver and class_id for mdev device with the match method for mdev bus. Reviewed-by: Parav Pandit Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 5 drivers/gpu/drm/i915/gvt/kvmgt.c

[Intel-gfx] [PATCH V10 2/6] modpost: add support for mdev class id

2019-11-06 Thread Jason Wang
Add support to parse mdev class id table. Reviewed-by: Parav Pandit Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- drivers/vfio/mdev/vfio_mdev.c | 2 ++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 11 +++ 3 files changed, 16

Re: [Intel-gfx] [PATCH V9 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 上午6:58, Alex Williamson wrote: On Wed, 6 Nov 2019 14:50:30 -0800 Randy Dunlap wrote: On 11/5/19 11:05 PM, Jason Wang wrote: diff --git a/samples/Kconfig b/samples/Kconfig index c8dacb4dda80..13a2443e18e0 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -131,6 +131,16

[Intel-gfx] [PATCH V11 5/6] virtio: introduce a mdev based transport

2019-11-07 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through virtio device specific ops. Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 13 ++ drivers/virtio/Makefile

[Intel-gfx] [PATCH V11 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 10 + samples/vfio-mdev/Makefile

[Intel-gfx] [PATCH V11 3/6] mdev: introduce device specific ops

2019-11-07 Thread Jason Wang
to be used by vfio-mdev and virtio-mdev. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 35 + MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c | 18 --- drivers/s390/cio

[Intel-gfx] [PATCH V11 4/6] mdev: introduce virtio device and its device ops

2019-11-07 Thread Jason Wang
This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- MAINTAINERS | 1 + drivers/vfio/mdev/mdev_core.c| 21 + drivers/vfio/mdev/mdev_private.h | 2

[Intel-gfx] [PATCH V9 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-05 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Acked-by: Cornelia Huck Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 10 + samples/vfio-mdev/Makefile

[Intel-gfx] [PATCH V9 5/6] virtio: introduce a mdev based transport

2019-11-05 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through device specific ops which is a part of mdev_parent_ops now. Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 13 ++ drivers/virtio

[Intel-gfx] [PATCH V9 3/6] mdev: introduce device specific ops

2019-11-05 Thread Jason Wang
to be used by vfio-mdev and virtio-mdev. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 35 + MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c | 18 --- drivers/s390/cio

[Intel-gfx] [PATCH V9 0/6] mdev based hardware virtio offloading support

2019-11-05 Thread Jason Wang
ot a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: class id support modpost: add support for mdev class id mdev: introduce device specific ops mdev: introduce virtio device and

[Intel-gfx] [PATCH V9 4/6] mdev: introduce virtio device and its device ops

2019-11-05 Thread Jason Wang
This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- MAINTAINERS | 1 + drivers/vfio/mdev/mdev_core.c| 21 + drivers/vfio/mdev/mdev_private.h | 2 + include/linux/mdev.h

[Intel-gfx] [PATCH V9 1/6] mdev: class id support

2019-11-05 Thread Jason Wang
. So this patch adds id_table to mdev_driver and class_id for mdev device with the match method for mdev bus. Reviewed-by: Parav Pandit Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 5 drivers/gpu/drm/i915/gvt/kvmgt.c

[Intel-gfx] [PATCH V9 2/6] modpost: add support for mdev class id

2019-11-05 Thread Jason Wang
Add support to parse mdev class id table. Reviewed-by: Parav Pandit Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- drivers/vfio/mdev/vfio_mdev.c | 2 ++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 11 +++ 3 files changed, 16

Re: [Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 下午5:08, Michael S. Tsirkin wrote: On Wed, Nov 06, 2019 at 09:35:31PM +0800, Jason Wang wrote: This sample driver creates mdev device that simulate virtio net device over virtio mdev transport. The device is implemented through vringh and workqueue. A device specific dma ops

Re: [Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 下午7:21, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 06:18:45PM +0800, Jason Wang wrote: On 2019/11/7 下午5:08, Michael S. Tsirkin wrote: On Wed, Nov 06, 2019 at 09:35:31PM +0800, Jason Wang wrote: This sample driver creates mdev device that simulate virtio net device over

Re: [Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 下午9:08, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 08:43:29PM +0800, Jason Wang wrote: On 2019/11/7 下午7:21, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 06:18:45PM +0800, Jason Wang wrote: On 2019/11/7 下午5:08, Michael S. Tsirkin wrote: On Wed, Nov 06, 2019 at 09:35

Re: [Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 下午9:08, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 08:47:06PM +0800, Jason Wang wrote: On 2019/11/7 下午8:43, Jason Wang wrote: On 2019/11/7 下午7:21, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 06:18:45PM +0800, Jason Wang wrote: On 2019/11/7 下午5:08, Michael S

Re: [Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 下午9:50, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 09:32:29PM +0800, Jason Wang wrote: On 2019/11/7 下午9:08, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 08:43:29PM +0800, Jason Wang wrote: On 2019/11/7 下午7:21, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 06:18

Re: [Intel-gfx] [PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-07 Thread Jason Wang
On 2019/11/7 下午8:43, Jason Wang wrote: On 2019/11/7 下午7:21, Michael S. Tsirkin wrote: On Thu, Nov 07, 2019 at 06:18:45PM +0800, Jason Wang wrote: On 2019/11/7 下午5:08, Michael S. Tsirkin wrote: On Wed, Nov 06, 2019 at 09:35:31PM +0800, Jason Wang wrote: This sample driver creates mdev device

[Intel-gfx] [PATCH V11 1/6] mdev: class id support

2019-11-07 Thread Jason Wang
. So this patch adds id_table to mdev_driver and class_id for mdev device with the match method for mdev bus. Reviewed-by: Parav Pandit Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 5 drivers/gpu/drm/i915/gvt/kvmgt.c

[Intel-gfx] [PATCH V11 2/6] modpost: add support for mdev class id

2019-11-07 Thread Jason Wang
Add support to parse mdev class id table. Reviewed-by: Parav Pandit Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- drivers/vfio/mdev/vfio_mdev.c | 2 ++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 11 +++ 3 files changed, 16

[Intel-gfx] [PATCH V11 0/6] mdev based hardware virtio offloading support

2019-11-07 Thread Jason Wang
ks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: class id support modpost: add support for mdev class id mdev: introduce device specific ops mdev: introduce virtio device and its device ops virtio: introduce a mdev based transport docs: sample driver to demons

Re: [Intel-gfx] [PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-10-30 Thread Jason Wang
On 2019/10/31 上午5:23, Christoph Hellwig wrote: On Wed, Oct 30, 2019 at 02:44:44PM +0800, Jason Wang wrote: This sample driver creates mdev device that simulate virtio net device over virtio mdev transport. The device is implemented through vringh and workqueue. A device specific dma ops

[Intel-gfx] [PATCH V12 0/6] mdev based hardware virtio offloading support

2019-11-17 Thread Jason Wang
implement the transport API, then it's not a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: make mdev bus agnostic mdev: split out VFIO bus specific parent ops mdev: move to dr

[Intel-gfx] [PATCH V12 2/6] mdev: split out VFIO bus specific parent ops

2019-11-17 Thread Jason Wang
and place the VFIO specific callbacks there like: struct mdev_vfio { struct mdev_device mdev; const struct mdev_vfio_ops *ops; }; Helpers for setting and getting the ops were introduced to support mdev vfio device to set ops and vfio mdev driver to use the ops. Signed-off-by: Jason Wang

[Intel-gfx] [PATCH V12 1/6] mdev: make mdev bus agnostic

2019-11-17 Thread Jason Wang
mdev_vfio module - require to specify the type of bus when registering mdev device and mdev driver With those modifications mdev become a generic module that could be used by multiple types of virtual buses and devices. Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst

[Intel-gfx] [PATCH V12 3/6] mdev: move to drivers/

2019-11-17 Thread Jason Wang
Mdev now is nothing VFIO specific, let's move it to upper directory. Signed-off-by: Jason Wang --- MAINTAINERS | 7 +-- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/mdev/Kconfig

[Intel-gfx] [PATCH V12 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-17 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 10 + samples/vfio-mdev/Makefile

[Intel-gfx] [PATCH V12 5/6] virtio: introduce a mdev based transport

2019-11-17 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through bus_ops of mdev parent. Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 13 ++ drivers/virtio/Makefile | 1 + drivers/virtio

[Intel-gfx] [PATCH V12 4/6] mdev: introduce mediated virtio bus

2019-11-17 Thread Jason Wang
This patch implements a mediated virtio bus over mdev framework. This will be used by the future virtio-mdev and vhost-mdev on top to allow driver from either userspace or kernel to control the device which is capable of offloading virtio datapath. Signed-off-by: Jason Wang --- MAINTAINERS

[Intel-gfx] [PATCH V13 5/6] virtio: introduce a mdev based transport

2019-11-18 Thread Jason Wang
the device with mdev based config ops. This means it is a software transport between mdev driver and mdev device. The transport was implemented through bus_ops of mdev parent. Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 13 ++ drivers/virtio/Makefile | 1 + drivers/virtio

[Intel-gfx] [PATCH V13 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-18 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 10 + samples/vfio-mdev/Makefile

Re: [Intel-gfx] [PATCH V12 0/6] mdev based hardware virtio offloading support

2019-11-18 Thread Jason Wang
On 2019/11/18 下午2:16, Jason Wang wrote: Hi all: There are hardwares that can do virtio datapath offloading while having its own control path. This path tries to implement a mdev based unified API to support using kernel virtio driver to drive those devices. This is done by introducing a new

[Intel-gfx] [PATCH V13 1/6] mdev: make mdev bus agnostic

2019-11-18 Thread Jason Wang
mdev_vfio module - require to specify the type of bus when registering mdev device and mdev driver With those modifications mdev become a generic module that could be used by multiple types of virtual buses and devices. Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst

[Intel-gfx] [PATCH V13 3/6] mdev: move to drivers/

2019-11-18 Thread Jason Wang
Mdev now is nothing VFIO specific, let's move it to upper directory. Signed-off-by: Jason Wang --- MAINTAINERS | 7 +-- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/mdev/Kconfig

[Intel-gfx] [PATCH V13 2/6] mdev: split out VFIO bus specific parent ops

2019-11-18 Thread Jason Wang
and place the VFIO specific callbacks there like: struct mdev_vfio { struct mdev_device mdev; const struct mdev_vfio_ops *ops; }; Helpers for setting and getting the ops were introduced to support mdev vfio device to set ops and vfio mdev driver to use the ops. Signed-off-by: Jason Wang

[Intel-gfx] [PATCH V13 4/6] mdev: introduce mediated virtio bus

2019-11-18 Thread Jason Wang
This patch implements a mediated virtio bus over mdev framework. This will be used by the future virtio-mdev and vhost-mdev on top to allow driver from either userspace or kernel to control the device which is capable of offloading virtio datapath. Signed-off-by: Jason Wang --- MAINTAINERS

[Intel-gfx] [PATCH V13 0/6] mdev based hardware virtio offloading support

2019-11-18 Thread Jason Wang
ders - drop the mdev_set_dma_ops() - use device_ops to implement the transport API, then it's not a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: make mdev bus agnostic mdev: split

Re: [Intel-gfx] [PATCH V12 5/6] virtio: introduce a mdev based transport

2019-11-18 Thread Jason Wang
On 2019/11/18 下午6:44, Michael S. Tsirkin wrote: +static const struct mdev_virtio_class_id virtio_id_table[] = { + { MDEV_VIRTIO_CLASS_ID_VIRTIO }, + { 0 }, +}; + Do we still need the class ID? It's a virtio mdev bus, do we need a virtio class as well? If we want to have auto

[Intel-gfx] [PATCH V8 0/6] mdev based hardware virtio offloading support

2019-11-05 Thread Jason Wang
then it's not a part of UAPI any more - use GFP_ATOMIC in mvnet sample device and other tweaks - set_vring_base/get_vring_base support for mvnet device Jason Wang (6): mdev: class id support modpost: add support for mdev class id mdev: introduce device specific ops mdev: introduce virtio

[Intel-gfx] [PATCH V8 1/6] mdev: class id support

2019-11-05 Thread Jason Wang
. So this patch adds id_table to mdev_driver and class_id for mdev device with the match method for mdev bus. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 5 drivers/gpu/drm/i915/gvt/kvmgt.c | 1 + drivers/s390/cio

[Intel-gfx] [PATCH V8 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-11-05 Thread Jason Wang
'virtio' type is supported right now. I plan to add 'vhost' type on top which requires some virtual IOMMU implemented in this sample driver. Signed-off-by: Jason Wang --- MAINTAINERS| 1 + samples/Kconfig| 7 + samples/vfio-mdev/Makefile | 1 + samples/vfio-mdev

Re: [Intel-gfx] [PATCH V8 0/6] mdev based hardware virtio offloading support

2019-11-06 Thread Jason Wang
On 2019/11/7 上午5:13, Alex Williamson wrote: On Wed, 6 Nov 2019 14:25:23 -0500 "Michael S. Tsirkin" wrote: On Wed, Nov 06, 2019 at 12:03:12PM -0700, Alex Williamson wrote: On Wed, 6 Nov 2019 11:56:46 +0800 Jason Wang wrote: On 2019/11/6 上午1:58, Alex Williamson wrote: On T

[Intel-gfx] [PATCH V8 3/6] mdev: introduce device specific ops

2019-11-05 Thread Jason Wang
to be used by vfio-mdev and virtio-mdev. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- .../driver-api/vfio-mediated-device.rst | 35 + MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c | 18 --- drivers/s390/cio

  1   2   >