Re: [PATCH RFC 2/3] usb, kcov: collect coverage from hub_event

2019-10-17 Thread Greg Kroah-Hartman
On Thu, Oct 17, 2019 at 09:06:56PM +0200, Andrey Konovalov wrote: > On Thu, Oct 17, 2019 at 8:19 PM Greg Kroah-Hartman > wrote: > > > > On Thu, Oct 17, 2019 at 07:44:14PM +0200, Andrey Konovalov wrote: > > > This patch adds kcov_remote_start/kcov_remote_stop annotations to the > > > hub_event func

Re: [PATCH RFC 3/3] vhost, kcov: collect coverage from vhost_worker

2019-10-17 Thread Greg Kroah-Hartman
On Thu, Oct 17, 2019 at 09:00:18PM +0200, Andrey Konovalov wrote: > On Thu, Oct 17, 2019 at 8:18 PM Greg Kroah-Hartman > wrote: > > > > On Thu, Oct 17, 2019 at 07:44:15PM +0200, Andrey Konovalov wrote: > > > This patch adds kcov_remote_start/kcov_remote_stop annotations to the > > > vhost_worker f

Re: [PATCH RFC 2/3] usb, kcov: collect coverage from hub_event

2019-10-17 Thread Greg Kroah-Hartman
On Thu, Oct 17, 2019 at 07:44:14PM +0200, Andrey Konovalov wrote: > This patch adds kcov_remote_start/kcov_remote_stop annotations to the > hub_event function, which is responsible for processing events on USB > buses, in particular events that happen during USB device enumeration. > Each USB bus g

Re: [PATCH RFC 3/3] vhost, kcov: collect coverage from vhost_worker

2019-10-17 Thread Greg Kroah-Hartman
On Thu, Oct 17, 2019 at 07:44:15PM +0200, Andrey Konovalov wrote: > This patch adds kcov_remote_start/kcov_remote_stop annotations to the > vhost_worker function, which is responsible for processing vhost works. > Since vhost_worker is spawned when a vhost device instance is created, > the common k

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

2019-10-17 Thread Alex Williamson
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/linux/mdev.h | 4 + > includ

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

2019-10-17 Thread Alex Williamson
On Thu, 17 Oct 2019 17:07:55 +0200 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

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

2019-10-17 Thread Cornelia Huck
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 > introduces device specific callbacks inside md

[PATCH 4/5] drm/qxl: use DEFINE_DRM_GEM_FOPS()

2019-10-17 Thread Gerd Hoffmann
We have no qxl-specific fops any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 65464630ac98..1d601f57a6ba 100644 --- a/drivers/

[PATCH 5/5] drm/qxl: allocate small objects top-down

2019-10-17 Thread Gerd Hoffmann
qxl uses small buffer objects for qxl commands. Allocate them top-down to reduce fragmentation. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_o

[PATCH 1/5] drm/qxl: drop qxl_ttm_fault

2019-10-17 Thread Gerd Hoffmann
Not sure what this hook is supposed to do. vmf->vma->vm_private_data should never be NULL, so the extra check in qxl_ttm_fault should have no effect. Drop it. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 27 +-- 1 file changed, 1 insertion(+), 26 del

virtualization@lists.linux-foundation.org

2019-10-17 Thread Gerd Hoffmann
Wire up the new drm_gem_ttm_mmap() helper function. Use generic drm_gem_mmap() and remove qxl_mmap(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 1 - drivers/gpu/drm/qxl/qxl_drv.c| 2 +- drivers/gpu/drm/qxl/qxl_object.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c| 16

[PATCH 3/5] drm/qxl: drop verify_access

2019-10-17 Thread Gerd Hoffmann
Not needed any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 629ac8e77a21..54cc5a5b607e 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/

[PATCH net 2/2] vsock/virtio: discard packets if credit is not respected

2019-10-17 Thread Stefano Garzarella
If the remote peer doesn't respect the credit information (buf_alloc, fwd_cnt), sending more data than it can send, we should drop the packets to prevent a malicious peer from using all of our memory. This is patch follows the VIRTIO spec: "VIRTIO_VSOCK_OP_RW data packets MUST only be transmitted

[PATCH net 1/2] vsock/virtio: send a credit update when buffer size is changed

2019-10-17 Thread Stefano Garzarella
When the user application set a new buffer size value, we should update the remote peer about this change, since it uses this information to calculate the credit available. Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 3 +++ 1 file changed, 3 insertions(+) dif

[PATCH net 0/2] vsock/virtio: make the credit mechanism more robust

2019-10-17 Thread Stefano Garzarella
This series makes the credit mechanism implemented in the virtio-vsock devices more robust. Patch 1 sends an update to the remote peer when the buf_alloc change. Patch 2 prevents a malicious peer (especially the guest) can consume all the memory of the other peer, discarding packets when the credit

Re: [PATCH -next] drm/qxl: Fix randbuild error

2019-10-17 Thread Gerd Hoffmann
On Tue, Oct 08, 2019 at 10:40:54AM +0800, YueHaibing wrote: > If DEM_QXL is y and DRM_TTM_HELPER is m, building fails: > > drivers/gpu/drm/qxl/qxl_object.o: undefined reference to > `drm_gem_ttm_print_info' > > Select DRM_TTM_HELPER to fix this. Queued up for drm-misc-next. thanks, Gerd ___

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

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

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

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

2019-10-17 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 | 12 +++ include/linux/mdev.h | 4 + include/linux/virtio_mdev.h | 151 ++ 3 fil

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

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

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

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

2019-10-17 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 V4 0/6] mdev based hardware virtio offloading support

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

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

2019-10-17 Thread Stefan Hajnoczi
On Thu, Oct 17, 2019 at 09:42:53AM +0800, Jason Wang wrote: > > 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: > > >

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

2019-10-17 Thread Jason Wang
On 2019/10/17 下午4:45, Cornelia Huck wrote: On Thu, 17 Oct 2019 16:30:43 +0800 Jason Wang wrote: On 2019/10/17 上午12:53, Alex Williamson wrote: Yet another suggestion: have the class id derive from the function you use to set up the ops. void mdev_set_vfio_ops(struct mdev_device *mdev, const

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

2019-10-17 Thread Cornelia Huck
On Thu, 17 Oct 2019 16:30:43 +0800 Jason Wang wrote: > On 2019/10/17 上午12:53, Alex Williamson wrote: > >>> Yet another suggestion: have the class id derive from the function > >>> you use to set up the ops. > >>> > >>> void mdev_set_vfio_ops(struct mdev_device *mdev, const struct > >>> vfio_mdev

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

2019-10-17 Thread Jason Wang
On 2019/10/17 上午12:53, Alex Williamson wrote: On Wed, 16 Oct 2019 15:31:25 + Parav Pandit wrote: -Original Message- From: Cornelia Huck Sent: Wednesday, October 16, 2019 3:53 AM To: Parav Pandit Cc: Alex Williamson ; Jason Wang ; k...@vger.kernel.org; linux-s...@vger.kernel.org;

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

2019-10-17 Thread Jason Wang
On 2019/10/16 下午12:57, Parav Pandit wrote: +static struct mdev_class_id id_table[] = { static const + { MDEV_ID_VFIO }, I guess you don't need extra braces for each entry. Since this enum represents MDEV class id, it better to name it as MDEV_CLASS_ID_VFIO. (Similar to PCI_VENDOR_ID,