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

2019-10-29 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 V6 5/6] virtio: introduce a mdev based transport

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

2019-10-29 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/virtio_mdev_o

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

2019-10-29 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 V6 2/6] modpost: add support for mdev class id

2019-10-29 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/vf

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

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

2019-10-29 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: [RFC] vhost_mdev: add network control vq support

2019-10-29 Thread Tiwei Bie
On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: > On 2019/10/29 下午6:17, Tiwei Bie wrote: > > This patch adds the network control vq support in vhost-mdev. > > A vhost-mdev specific op is introduced to allow parent drivers > > to handle the network control commands come from userspace. >

Re: [PATCH v3] vhost: introduce mdev based hardware backend

2019-10-29 Thread Tiwei Bie
On Wed, Oct 30, 2019 at 09:55:57AM +0800, Jason Wang wrote: > On 2019/10/29 下午6:07, Tiwei Bie wrote: > > This patch introduces a mdev based hardware vhost backend. > > This backend is built on top of the same abstraction used > > in virtio-mdev and provides a generic vhost interface for > > userspa

Re: [PATCH v3] vhost: introduce mdev based hardware backend

2019-10-29 Thread Jason Wang
On 2019/10/29 下午6:07, Tiwei Bie wrote: > This patch introduces a mdev based hardware vhost backend. > This backend is built on top of the same abstraction used > in virtio-mdev and provides a generic vhost interface for > userspace to accelerate the virtio devices in guest. > > This backend is imp

Re: [PATCH v2] vhost: introduce mdev based hardware backend

2019-10-29 Thread Tiwei Bie
On Tue, Oct 29, 2019 at 06:48:27PM +0800, Jason Wang wrote: > On 2019/10/29 下午5:57, Tiwei Bie wrote: > > On Mon, Oct 28, 2019 at 11:50:49AM +0800, Jason Wang wrote: > >> On 2019/10/28 上午9:58, Tiwei Bie wrote: > >>> On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S. Tsirkin wrote: > On Fri, O

Re: [PATCH v9 10/11] x86/paravirt: Adapt assembly for PIE support

2019-10-29 Thread Thomas Garnier
On Mon, Aug 12, 2019 at 5:54 AM Borislav Petkov wrote: > > On Wed, Jul 31, 2019 at 02:53:06PM +0200, Peter Zijlstra wrote: > > On Tue, Jul 30, 2019 at 12:12:54PM -0700, Thomas Garnier wrote: > > > if PIE is enabled, switch the paravirt assembly constraints to be > > > compatible. The %c/i constrai

Re: [PATCH net-next 12/14] vsock/vmci: register vmci_transport only when VMCI guest/host are active

2019-10-29 Thread Stefano Garzarella
On Sun, Oct 27, 2019 at 09:17:52AM +0100, Stefan Hajnoczi wrote: > On Wed, Oct 23, 2019 at 11:55:52AM +0200, Stefano Garzarella wrote: > > +static int __init vmci_transport_init(void) > > +{ > > + int features = VSOCK_TRANSPORT_F_DGRAM; > > Where is this variable used? It is introduced in the p

Re: [PATCH net-next 00/14] vsock: add multi-transports support

2019-10-29 Thread Stefano Garzarella
On Sun, Oct 27, 2019 at 09:01:46AM +0100, Stefan Hajnoczi wrote: > On Wed, Oct 23, 2019 at 11:55:40AM +0200, Stefano Garzarella wrote: > > This series adds the multi-transports support to vsock, following > > this proposal: https://www.spinics.net/lists/netdev/msg575792.html > > > > With the multi

[RFC PATCH 2/2] virtio: allow query vq parent device

2019-10-29 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 16 ++-- include/linux/virtio_config.h | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 51d83f4d7c32..ddeef7421d4d 100644 --- a/drive

[RFC PATCH 1/2] virtio: accept parent as a parameter when allocating virtqueue

2019-10-29 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index bdc08244a648..51d83f4d7c32 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drive

[RFC PATCH 0/2] virtio: allow per vq DMA domain

2019-10-29 Thread Jason Wang
We used to have use a single parent for all DMA operations. This tends to complicate the mdev based hardware virtio datapath offloading which may not implement the control path over datapath like ctrl vq in the case of virtio-net. So this series tries to intorduce per DMA domain by allowing trasnp

Re: [RFC] vhost_mdev: add network control vq support

2019-10-29 Thread Jason Wang
On 2019/10/29 下午6:17, Tiwei Bie wrote: > This patch adds the network control vq support in vhost-mdev. > A vhost-mdev specific op is introduced to allow parent drivers > to handle the network control commands come from userspace. Probably work for userspace driver but not kernel driver. > > Si

Re: [PATCH v2] vhost: introduce mdev based hardware backend

2019-10-29 Thread Jason Wang
On 2019/10/29 下午5:57, Tiwei Bie wrote: > On Mon, Oct 28, 2019 at 11:50:49AM +0800, Jason Wang wrote: >> On 2019/10/28 上午9:58, Tiwei Bie wrote: >>> On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S. Tsirkin wrote: On Fri, Oct 25, 2019 at 05:54:55PM +0800, Jason Wang wrote: > On 2019/10/2

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

[RFC] vhost_mdev: add network control vq support

2019-10-29 Thread Tiwei Bie
This patch adds the network control vq support in vhost-mdev. A vhost-mdev specific op is introduced to allow parent drivers to handle the network control commands come from userspace. Signed-off-by: Tiwei Bie --- This patch depends on below patch: https://lkml.org/lkml/2019/10/29/335 drivers/v

[PATCH v3] vhost: introduce mdev based hardware backend

2019-10-29 Thread Tiwei Bie
This patch introduces a mdev based hardware vhost backend. This backend is built on top of the same abstraction used in virtio-mdev and provides a generic vhost interface for userspace to accelerate the virtio devices in guest. This backend is implemented as a mdev device driver on top of the same

Re: [PATCH v2] vhost: introduce mdev based hardware backend

2019-10-29 Thread Tiwei Bie
On Mon, Oct 28, 2019 at 11:50:49AM +0800, Jason Wang wrote: > On 2019/10/28 上午9:58, Tiwei Bie wrote: > > On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Oct 25, 2019 at 05:54:55PM +0800, Jason Wang wrote: > > > > On 2019/10/24 下午6:42, Jason Wang wrote: > > > > > Ye