[PATCH 02/10] drm/virtio: fix endianness in primary_plane_update

2016-12-07 Thread Jason Wang
o/virtgpu_plane.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Jason Wang > > diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c > b/drivers/gpu/drm/virtio/virtgpu_plane.c > index ba28c0f..1fda965 100644 > --- a/drivers/gpu/drm/virtio/virtgpu

[PATCH 03/10] drm/virtio: fix lock context imbalance

2016-12-07 Thread Jason Wang
Michael S. Tsirkin > --- > drivers/gpu/drm/virtio/virtgpu_vq.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Jason Wang > > diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c > b/drivers/gpu/drm/virtio/virtgpu_vq.c > index 5a0f8a7..2f0c2f

[PATCH 10/10] virtio: enable endian checks for sparse builds

2016-12-07 Thread Jason Wang
lds. > > Signed-off-by: Michael S. Tsirkin > --- > > It seems that there should be a better way to do it, > but this works too. Reviewed-by: Jason Wang > > drivers/block/Makefile | 1 + > drivers/char/Makefile | 1 + > drivers/char/hw_rand

[PATCH 04/10] drm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked

2016-12-07 Thread Jason Wang
o_gpu_vbuffer *vbuf) > + __releases(>ctrlq.qlock) > + __acquires(>ctrlq.qlock) > { > struct virtqueue *vq = vgdev->ctrlq.vq; > struct scatterlist *sgs[3], vcmd, vout, vresp; Reviewed-by: Jason Wang

[PATCH] drm/qxl: return IRQ_NONE if it was not our irq

2014-05-12 Thread Jason Wang
kernel think it was handled but in fact it was not. Cc: Gerd Hoffmann Cc: stable at vger.kernel.org Signed-off-by: Jason Wang --- drivers/gpu/drm/qxl/qxl_irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_irq.c b/drivers/gpu/drm/qxl/qxl_irq.c index 28f84b4..3485bdc

[PATCH] drm/qxl: return IRQ_NONE if it was not our irq

2014-07-16 Thread Jason Wang
On 05/12/2014 04:35 PM, Jason Wang wrote: > Return IRQ_NONE if it was not our irq. This is necessary for the case > when qxl is sharing irq line with a device A in a crash kernel. If qxl > is initialized before A and A's irq was raised during this gap, > returning IRQ_HANDLED

Re: [PATCH 1/6] virtio: wrap find_vqs

2017-03-30 Thread Jason Wang
On 2017年03月30日 04:48, Michael S. Tsirkin wrote: We are going to add more parameters to find_vqs, let's wrap the call so we don't need to tweak all drivers every time. Signed-off-by: Michael S. Tsirkin --- A quick glance and it looks ok, but what the benefit of this series,

Re: [PATCH 1/6] virtio: wrap find_vqs

2017-04-01 Thread Jason Wang
On 2017年03月30日 22:32, Michael S. Tsirkin wrote: On Thu, Mar 30, 2017 at 02:00:08PM +0800, Jason Wang wrote: On 2017年03月30日 04:48, Michael S. Tsirkin wrote: We are going to add more parameters to find_vqs, let's wrap the call so we don't need to tweak all drivers every time. Signed-off

[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

[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

[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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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-deve

Re: [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-devel@l

[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

[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

[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

[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

[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

Re: [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-devel@l

[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

[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

[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

[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)

[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

[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

[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

[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

[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

[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

[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

Re: [RFC PATCH V2 0/6] mdev based hardware virtio offloading support

2019-09-22 Thread Jason Wang
On 2019/9/20 下午4:20, Jason Wang wrote: Hi all: There are hardware 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

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

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

[PATCH 2/6] mdev: introduce device specific ops

2019-09-23 Thread Jason Wang
ops (e.g vfio 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 +- MAINTAINERS | 1 + drivers/gpu/drm/i915/gvt/kvmgt.c

[PATCH 1/6] mdev: class id support

2019-09-23 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 | 7 +-- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- drivers/s390/cio/vfio_ccw_ops.c

[PATCH 0/6] mdev based hardware virtio offloading support

2019-09-23 Thread Jason Wang
s() - 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 mdev: introduce device specific ops mdev: int

[PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()

2019-09-23 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

[PATCH 4/6] virtio: introduce a mdev based transport

2019-09-23 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 --- MAINTAINERS | 1 + drivers/vfio/mdev

[PATCH 3/6] mdev: introduce virtio device and its device ops

2019-09-23 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 | 7 ++ include/linux/mdev.h | 4 + include/linux/virtio_mdev.h | 144 ++ 3

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

2019-09-25 Thread Jason Wang
On 2019/9/25 上午7:06, Alex Williamson wrote: > On Tue, 24 Sep 2019 21:53:29 +0800 > Jason Wang wrote: > >> Currently, except for the create and remove, the rest of >> mdev_parent_ops is designed for vfio-mdev driver only and may not help >> for kernel mdev driver

Re: [PATCH V2 2/8] mdev: class id support

2019-09-25 Thread Jason Wang
On 2019/9/25 上午7:06, Alex Williamson wrote: > On Tue, 24 Sep 2019 21:53: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, >> the first

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

2019-09-25 Thread Jason Wang
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 that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- include/linux/mdev.h

Re: [PATCH V2 0/8] mdev based hardware virtio offloading support

2019-09-25 Thread Jason Wang
On 2019/9/25 下午4:24, Tian, Kevin wrote: >> From: Jason Wang [mailto:jasow...@redhat.com] >> Sent: Tuesday, September 24, 2019 9:53 PM >> >> Hi all: >> >> There are hardware that can do virtio datapath offloading while having >> its own control path.

Re: [PATCH V2 2/8] mdev: class id support

2019-09-25 Thread Jason Wang
On 2019/9/25 下午4:28, Tian, Kevin wrote: >> From: Jason Wang >> Sent: Tuesday, September 24, 2019 9:53 PM >> >> 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, >> t

Re: [PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()

2019-09-25 Thread Jason Wang
On 2019/9/24 下午10:04, Alex Williamson wrote: > On Mon, 23 Sep 2019 12:00:41 -0400 > "Michael S. Tsirkin" wrote: > >> On Mon, Sep 23, 2019 at 09:45:59AM -0600, Alex Williamson wrote: >>> On Mon, 23 Sep 2019 21:03:30 +0800 >>> Jason Wang wrote: >

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

2019-09-25 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 >> --

Re: [PATCH 07/11] vhost: convert vhost_umem_interval_tree to half closed intervals

2019-10-09 Thread Jason Wang
closed interval and also reduces the chances of some caller being missed. Cc: Michael S. Tsirkin" Cc: Jason Wang Cc: virtualizat...@lists.linux-foundation.org Signed-off-by: Davidlohr Bueso --- drivers/vhost/vhost.c | 19 +-- drivers/vhost/vhost.h | 4 ++-- 2 files change

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

2019-10-09 Thread Jason Wang
On 2019/10/1 上午5:36, Alex Williamson wrote: On Fri, 27 Sep 2019 16:25:13 + Parav Pandit wrote: Hi Alex, -Original Message- From: Alex Williamson Sent: Tuesday, September 24, 2019 6:07 PM To: Jason Wang Cc: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- ker

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

2019-10-10 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

[PATCH V3 1/7] mdev: class id support

2019-10-11 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 --- Documentation/driver-api/vfio-mediated-device.rst | 7 ++- drivers/gpu/drm/i915/gvt/kvmgt.c | 1 + drivers/s390/cio/vfio_ccw_ops.c

[PATCH V3 0/7] mdev based hardware virtio offloading support

2019-10-11 Thread Jason Wang
ice_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 (7): mdev: class id support mdev: bus uevent support modpost: add support for mdev class

[PATCH V3 6/7] virtio: introduce a mdev based transport

2019-10-11 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

[PATCH V3 2/7] mdev: bus uevent support

2019-10-11 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

[PATCH V3 3/7] modpost: add support for mdev class id

2019-10-11 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

[PATCH V3 5/7] mdev: introduce virtio device and its device ops

2019-10-11 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| 1 + include/linux/virtio_mdev.h | 148 2 files changed, 149 insertions(+) create mode

[PATCH V3 4/7] mdev: introduce device specific ops

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

[PATCH V3 7/7] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-10-11 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: [PATCH V4 4/6] mdev: introduce virtio device and its device ops

2019-10-18 Thread Jason Wang
On 2019/10/18 下午5:46, Tiwei Bie wrote: On Thu, Oct 17, 2019 at 06:48:34PM +0800, Jason Wang wrote: + * @get_vq_state: Get the state for a virtqueue + * @mdev: mediated device + * @idx: virtqueue index

Re: [PATCH V4 4/6] mdev: introduce virtio device and its device ops

2019-10-18 Thread Jason Wang
On 2019/10/18 上午1:53, Alex Williamson wrote: On Thu, 17 Oct 2019 18:48:34 +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 | 12 +++ include

Re: [PATCH V4 3/6] mdev: introduce device specific ops

2019-10-18 Thread Jason Wang
On 2019/10/17 下午11:07, Cornelia Huck wrote: On Thu, 17 Oct 2019 18:48:33 +0800 Jason Wang wrote: Currently, except for the create and remove, the rest of mdev_parent_ops is designed for vfio-mdev driver only and may not help for kernel mdev driver. With the help of class id, this patch

Re: [PATCH V4 3/6] mdev: introduce device specific ops

2019-10-21 Thread Jason Wang
On 2019/10/21 上午7:41, Parav Pandit wrote: -Original Message- From: Jason Wang Sent: Thursday, October 17, 2019 5:49 AM To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- ker...@vger.kernel.org; dri-devel@lists.freedesktop.org; intel- g...@lists.freedesktop.org; intel-gvt

Re: [PATCH V4 4/6] mdev: introduce virtio device and its device ops

2019-10-20 Thread Jason Wang
On 2019/10/18 下午9:30, Cornelia Huck wrote: On Fri, 18 Oct 2019 18:55:02 +0800 Jason Wang wrote: On 2019/10/18 下午5:46, Cornelia Huck wrote: On Thu, 17 Oct 2019 18:48:34 +0800 Jason Wang wrote: + * @get_vendor_id: Get virtio vendor id + * @mdev

Re: [PATCH V4 5/6] virtio: introduce a mdev based transport

2019-10-21 Thread Jason Wang
On 2019/10/18 下午10:20, Cornelia Huck wrote: On Thu, 17 Oct 2019 18:48:35 +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

Re: [PATCH V4 4/6] mdev: introduce virtio device and its device ops

2019-10-18 Thread Jason Wang
On 2019/10/18 下午5:46, Cornelia Huck wrote: On Thu, 17 Oct 2019 18:48:34 +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 | 12 +++ include

Re: [PATCH V4 5/6] virtio: introduce a mdev based transport

2019-10-21 Thread Jason Wang
On 2019/10/21 下午5:36, Cornelia Huck wrote: On Mon, 21 Oct 2019 13:59:23 +0800 Jason Wang wrote: On 2019/10/18 下午10:20, Cornelia Huck wrote: On Thu, 17 Oct 2019 18:48:35 +0800 Jason Wang wrote: This patch introduces a new mdev transport for virtio. This is used to use kernel virtio

Re: [PATCH V3 1/7] mdev: class id support

2019-10-15 Thread Jason Wang
On 2019/10/16 上午12:38, Alex Williamson wrote: On Fri, 11 Oct 2019 16:15:51 +0800 Jason Wang wrote: diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index b558d4cfd082..724e9b9841d8 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c

Re: [PATCH V3 0/7] mdev based hardware virtio offloading support

2019-10-14 Thread Jason Wang
On 2019/10/15 上午1:49, Stefan Hajnoczi wrote: On Fri, Oct 11, 2019 at 04:15:50PM +0800, Jason Wang wrote: There are hardware 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

Re: [PATCH V3 6/7] virtio: introduce a mdev based transport

2019-10-14 Thread Jason Wang
On 2019/10/15 上午1:39, Stefan Hajnoczi wrote: On Fri, Oct 11, 2019 at 04:15:56PM +0800, Jason Wang wrote: +struct virtio_mdev_device { + struct virtio_device vdev; + struct mdev_device *mdev; + unsigned long version; + + struct virtqueue **vqs; + /* The lock

Re: [PATCH V3 5/7] mdev: introduce virtio device and its device ops

2019-10-14 Thread Jason Wang
On 2019/10/15 上午1:23, Stefan Hajnoczi wrote: On Fri, Oct 11, 2019 at 04:15:55PM +0800, Jason Wang wrote: + * @set_vq_cb: Set the interrut calback function for s/interrut/interrupt/ s/calback/callback/ Fixed. Thanks

Re: [PATCH V3 1/7] mdev: class id support

2019-10-16 Thread Jason Wang
On 2019/10/16 下午12:57, Parav Pandit wrote: -Original Message- From: Jason Wang Sent: Friday, October 11, 2019 3:16 AM To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- ker...@vger.kernel.org; dri-devel@lists.freedesktop.org; intel- g...@lists.freedesktop.org; intel-gvt

Re: [PATCH V5 4/6] mdev: introduce virtio device and its device ops

2019-10-24 Thread Jason Wang
On 2019/10/25 上午4:44, Alex Williamson wrote: On Thu, 24 Oct 2019 11:51:35 +0800 Jason Wang wrote: On 2019/10/24 上午5:57, Alex Williamson wrote: On Wed, 23 Oct 2019 21:07:50 +0800 Jason Wang wrote: This patch implements basic support for mdev driver that supports virtio transport

Re: [PATCH V5 1/6] mdev: class id support

2019-10-24 Thread Jason Wang
On 2019/10/25 上午4:13, Alex Williamson wrote: On Thu, 24 Oct 2019 13:46:36 -0600 Alex Williamson wrote: On Thu, 24 Oct 2019 11:27:36 +0800 Jason Wang wrote: On 2019/10/24 上午5:42, Alex Williamson wrote: On Wed, 23 Oct 2019 21:07:47 +0800 Jason Wang wrote: Mdev bus only supports vfio

Re: [PATCH V5 2/6] modpost: add support for mdev class id

2019-10-24 Thread Jason Wang
On 2019/10/25 上午3:54, Alex Williamson wrote: On Thu, 24 Oct 2019 11:31:04 +0800 Jason Wang wrote: On 2019/10/24 上午5:42, Alex Williamson wrote: On Wed, 23 Oct 2019 21:07:48 +0800 Jason Wang wrote: Add support to parse mdev class id table. Reviewed-by: Parav Pandit Signed-off-by: Jason

Re: [PATCH V5 4/6] mdev: introduce virtio device and its device ops

2019-10-29 Thread Jason Wang
On 2019/10/29 下午3:42, Zhu Lingshan wrote: >> >> +    void (*set_status)(struct mdev_device *mdev, u8 status); > > Hi Jason > > Is it possible to make set_status() return an u8 or bool, because this > may fail in real hardware. Without a returned code, I am not sure  > whether it is a good idea to

[PATCH V5 0/6] mdev based hardware virtio offloading support

2019-10-23 Thread Jason Wang
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 modpost: add support f

[PATCH V5 3/6] mdev: introduce device specific ops

2019-10-23 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

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

2019-10-23 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

[PATCH V5 5/6] virtio: introduce a mdev based transport

2019-10-23 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

[PATCH V5 2/6] modpost: add support for mdev class id

2019-10-23 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 | 10 ++ 3 files changed, 15 insertions(+) diff --git a/drivers

[PATCH V5 1/6] mdev: class id support

2019-10-23 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

[PATCH V5 4/6] mdev: introduce virtio device and its device ops

2019-10-23 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

Re: [PATCH V5 1/6] mdev: class id support

2019-10-23 Thread Jason Wang
On 2019/10/24 上午5:42, Alex Williamson wrote: On Wed, 23 Oct 2019 21:07: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: [PATCH V5 2/6] modpost: add support for mdev class id

2019-10-23 Thread Jason Wang
On 2019/10/24 上午5:42, Alex Williamson wrote: On Wed, 23 Oct 2019 21:07:48 +0800 Jason Wang wrote: 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

Re: [PATCH V5 4/6] mdev: introduce virtio device and its device ops

2019-10-23 Thread Jason Wang
On 2019/10/24 上午5:57, Alex Williamson wrote: On Wed, 23 Oct 2019 21:07: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: [PATCH V3 0/7] mdev based hardware virtio offloading support

2019-10-16 Thread Jason Wang
On 2019/10/15 下午10:37, Stefan Hajnoczi wrote: On Tue, Oct 15, 2019 at 11:37:17AM +0800, Jason Wang wrote: On 2019/10/15 上午1:49, Stefan Hajnoczi wrote: On Fri, Oct 11, 2019 at 04:15:50PM +0800, Jason Wang wrote: There are hardware that can do virtio datapath offloading while having its own

[PATCH V4 1/6] mdev: class id support

2019-10-17 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 | 7 +- drivers/gpu/drm/i915/gvt/kvmgt.c | 1 + drivers/s390/cio/vfio_ccw_ops.c

[PATCH V4 0/6] mdev based hardware virtio offloading support

2019-10-17 Thread Jason Wang
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 modpost: add support for mdev class id mdev: introduce device specific ops

[PATCH V4 2/6] modpost: add support for mdev class id

2019-10-17 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

  1   2   >