Re: [PATCH] vhost: It's better to use size_t for the 3rd parameter of vhost_exceeds_weight()

2019-09-24 Thread Jason Wang
On 2019/9/23 下午5:12, wangxu (AE) wrote: Hi Michael Thanks for your fast reply. As the following code, the 2nd branch of iov_iter_advance() does not check if i->count < size, when this happens, i->count -= size may cause len exceed INT_MAX, and then total_len exceed INT_MAX.

Re: [PATCH] virtio_mmio: remove redundant dev_err message

2019-09-24 Thread Jason Wang
On 2019/9/24 下午3:21, Ding Xiang wrote: platform_get_irq already contains error message, Is this message contained in all possible error path? If not, it's probably better to keep it as is. Thanks so remove the redundant dev_err message Signed-off-by: Ding Xiang ---

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

2019-09-24 Thread Alex Williamson
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/virtio_mdev.h | 145

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

2019-09-24 Thread Alex Williamson
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 driver could be virtio-mdev. This means we need to add > device class id support in bus

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

2019-09-24 Thread Alex Williamson
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. With the help of class id, this patch > introduces device specific callbacks inside

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

2019-09-24 Thread Alex Williamson
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: > > > > > We want to copy from iov to buf, so the direction was wrong. > > > > > > Signed-off-by:

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

2019-09-24 Thread Jason Wang
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 is to make sure HVA is used directly as the IOVA. This should be sufficient for kernel virtio driver to work. Only

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

2019-09-24 Thread Jason Wang
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 driver will be registered to the mdev bus, when a new virtio-mdev device is probed, it will register the

[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 5/8] mdev: introduce device specific ops

2019-09-24 Thread Jason Wang
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 introduces device specific callbacks inside mdev_device structure. This allows different set of callback to

[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

[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

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

2019-09-24 Thread Jason Wang
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 need to add device class id support in bus match method to pair the mdev device and mdev driver correctly.

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

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

2019-09-24 Thread Jason Wang
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 mdev transport for virtio (virtio_mdev) and

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-de...@lists.freedesktop.org; intel- >>

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-de...@lists.freedesktop.org; intel- >>

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

2019-09-24 Thread Jason Wang
On 2019/9/23 下午11:36, Michael S. Tsirkin wrote: > On Mon, Sep 23, 2019 at 11:20:12PM +0800, kbuild test robot wrote: >> Hi Jason, >> >> I love your patch! Yet something to improve: >> >> [auto build test ERROR on linus/master] >> [cannot apply to v5.3 next-20190920] >> [if your patch is applied

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-de...@lists.freedesktop.org; intel- >>

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-de...@lists.freedesktop.org; intel- >>

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 example is virtio-mdev[1] driver. This

Re: Xorg indefinitely hangs in kernelspace

2019-09-24 Thread Jaak Ristioja
On 05.09.19 15:34, Jaak Ristioja wrote: > On 05.09.19 10:14, Gerd Hoffmann wrote: >> On Tue, Aug 06, 2019 at 09:00:10PM +0300, Jaak Ristioja wrote: >>> Hello! >>> >>> I'm writing to report a crash in the QXL / DRM code in the Linux kernel. >>> I originally filed the issue on LaunchPad and more