[PULL] vhost: cleanups and fixes

2019-10-15 Thread Michael S. Tsirkin
The following changes since commit da0c9ea146cbe92b832f1b0f694840ea8eb33cce: Linux 5.4-rc2 (2019-10-06 14:27:30 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up to

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

2019-10-15 Thread Alex Williamson
On Tue, 15 Oct 2019 20:17:01 +0800 Jason Wang wrote: > On 2019/10/15 下午6:41, Cornelia Huck wrote: > > On Fri, 11 Oct 2019 16:15:54 +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

Re: [PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-15 Thread Michael S. Tsirkin
On Mon, Oct 14, 2019 at 09:43:25AM +0800, Jason Wang wrote: > > On 2019/10/13 上午4:27, Michael S. Tsirkin wrote: > > On Sat, Oct 12, 2019 at 03:28:49PM +0800, Jason Wang wrote: > > > On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: > > > > The idea is to support multiple ring formats by converting

Re: [PULL] vhost: cleanups and fixes

2019-10-15 Thread pr-tracker-bot
The pull request you sent on Tue, 15 Oct 2019 17:19:08 -0400: > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/3b1f00aceb7a67bf079a5a64aa5c6baf78a8f442 Thank you! -- Deet-doot-dot, I am a

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

2019-10-15 Thread Alex Williamson
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 > @@ -45,6 +45,12 @@ void

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

2019-10-15 Thread Stefan Hajnoczi
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 control path. This path tries to

0-copy (was Re: question: asynchronous notification from vhost)

2019-10-15 Thread Guennadi Liakhovetski
On Tue, Oct 15, 2019 at 11:23:13AM +0200, Guennadi Liakhovetski wrote: > Hi, > > I'm developing a virtualised audio / DSP virtio and vhost driver pair > and I'm currently somewhat stuck trying to figure out how to > asynchronously notify the guest from the vhost driver. I'm using the >

[PATCH 1/5] virtiofs: Do not end request in submission context

2019-10-15 Thread Vivek Goyal
Submission context can hold some locks which end request code tries to hold again and deadlock can occur. For example, fc->bg_lock. If a background request is being submitted, it might hold fc->bg_lock and if we could not submit request (because device went away) and tried to end request, then

[PATCH 5/5] virtiofs: Retry request submission from worker context

2019-10-15 Thread Vivek Goyal
If regular request queue gets full, currently we sleep for a bit and retrying submission in submitter's context. This assumes submitter is not holding any spin lock. But this assumption is not true for background requests. For background requests, we are called with fc->bg_lock held. This can

[PATCH 4/5] virtiofs: Count pending forgets as in_flight forgets

2019-10-15 Thread Vivek Goyal
If virtqueue is full, we put forget requests on a list and these forgets are dispatched later using a worker. As of now we don't count these forgets in fsvq->in_flight variable. This means when queue is being drained, we have to have special logic to first drain these pending requests and then

[PATCH 3/5] virtiofs: Set FR_SENT flag only after request has been sent

2019-10-15 Thread Vivek Goyal
FR_SENT flag should be set when request has been sent successfuly sent over virtqueue. This is used by interrupt logic to figure out if interrupt request should be sent or not. Also add it to fqp->processing list after sending it successfully. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c

[PATCH 0/5] virtiofs: Fix couple of deadlocks

2019-10-15 Thread Vivek Goyal
Hi, We have couple of places which can result in deadlock. This patch series fixes these. We can be called with fc->bg_lock (for background requests) while submitting a request. This leads to two constraints. - We can't end requests in submitter's context and call fuse_end_request() as it

[PATCH 2/5] virtiofs: No need to check fpq->connected state

2019-10-15 Thread Vivek Goyal
In virtiofs we keep per queue connected state in virtio_fs_vq->connected and use that to end request if queue is not connected. And virtiofs does not even touch fpq->connected state. We probably need to merge these two at some point of time. For now, simplify the code a bit and do not worry about

[PATCH] vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt'

2019-10-15 Thread Stefano Garzarella
The 'work' field was introduced with commit 06a8fc78367d0 ("VSOCK: Introduce virtio_vsock_common.ko") but it is never used in the code, so we can remove it to save memory allocated in the per-packet 'struct virtio_vsock_pkt' Suggested-by: Michael S. Tsirkin Signed-off-by: Stefano Garzarella ---

Re: [PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-15 Thread Jason Wang
On 2019/10/16 上午4:20, Michael S. Tsirkin wrote: On Mon, Oct 14, 2019 at 09:43:25AM +0800, Jason Wang wrote: On 2019/10/13 上午4:27, Michael S. Tsirkin wrote: On Sat, Oct 12, 2019 at 03:28:49PM +0800, Jason Wang wrote: On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: The idea is to support

Re: [RFC 1/2] vhost: IFC VF hardware operation layer

2019-10-15 Thread Stephen Hemminger
On Wed, 16 Oct 2019 09:03:17 +0800 Zhu Lingshan wrote: > + IFC_INFO(>dev, "PCI capability mapping:\n" > + "common cfg: %p\n" > + "notify base: %p\n" > + "isr cfg: %p\n" > + "device

Re: [RFC 1/2] vhost: IFC VF hardware operation layer

2019-10-15 Thread Stephen Hemminger
On Wed, 16 Oct 2019 09:03:17 +0800 Zhu Lingshan wrote: > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + int ret; > + u8 pos; > + struct virtio_pci_cap cap; > + u32 i; > + u16 notify_off; For network code, the preferred declaration style is reverse

Re: [PATCH] vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt'

2019-10-15 Thread David Miller
From: Stefano Garzarella Date: Tue, 15 Oct 2019 17:00:51 +0200 > The 'work' field was introduced with commit 06a8fc78367d0 > ("VSOCK: Introduce virtio_vsock_common.ko") > but it is never used in the code, so we can remove it to save > memory allocated in the per-packet 'struct virtio_vsock_pkt'

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 1/2] dma-mapping: Add dma_addr_is_phys_addr()

2019-10-15 Thread Christoph Hellwig
On Mon, Oct 14, 2019 at 11:29:24AM +0100, Robin Murphy wrote: >> However, I would like to see the commit message (and maybe the inline >> comments) expanded a bit on what the distinction here is about. Some >> of the text from the next patch would be suitable, about DMA addresses >> usually being

RE: [PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()

2019-10-15 Thread Ram Pai
On Mon, Oct 14, 2019 at 11:29:24AM +0100, Robin Murphy wrote: > On 14/10/2019 05:51, David Gibson wrote: > >On Fri, Oct 11, 2019 at 06:25:18PM -0700, Ram Pai wrote: > >>From: Thiago Jung Bauermann > >> > >>In order to safely use the DMA API, virtio needs to know whether DMA > >>addresses are in

question: asynchronous notification from vhost

2019-10-15 Thread Guennadi Liakhovetski
Hi, I'm developing a virtualised audio / DSP virtio and vhost driver pair and I'm currently somewhat stuck trying to figure out how to asynchronously notify the guest from the vhost driver. I'm using the vhost_add_used_and_signal() function to return data back to the guest in the guest

Re: [PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted

2019-10-15 Thread Christoph Hellwig
On Fri, Oct 11, 2019 at 06:25:19PM -0700, Ram Pai wrote: > From: Thiago Jung Bauermann > > Normally, virtio enables DMA API with VIRTIO_F_IOMMU_PLATFORM, which must > be set by both device and guest driver. However, as a hack, when DMA API > returns physical addresses, guest driver can use the

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

2019-10-15 Thread Cornelia Huck
On Fri, 11 Oct 2019 16:15:51 +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 V3 2/7] mdev: bus uevent support

2019-10-15 Thread Cornelia Huck
On Fri, 11 Oct 2019 16:15:52 +0800 Jason Wang wrote: > 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

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

2019-10-15 Thread Cornelia Huck
On Fri, 11 Oct 2019 16:15:54 +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 net 0/2] vsock: don't allow half-closed socket in the host transports

2019-10-15 Thread Stefan Hajnoczi
On Sat, Oct 12, 2019 at 06:38:46PM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 11, 2019 at 04:34:57PM +0200, Stefano Garzarella wrote: > > On Fri, Oct 11, 2019 at 10:19:13AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Oct 11, 2019 at 03:07:56PM +0200, Stefano Garzarella wrote: > > > > We are

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

2019-10-15 Thread Jason Wang
On 2019/10/15 下午6:26, Cornelia Huck wrote: On Fri, 11 Oct 2019 16:15:51 +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

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

2019-10-15 Thread Jason Wang
On 2019/10/15 下午6:27, Cornelia Huck wrote: On Fri, 11 Oct 2019 16:15:52 +0800 Jason Wang wrote: 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

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

2019-10-15 Thread Jason Wang
On 2019/10/15 下午6:41, Cornelia Huck wrote: On Fri, 11 Oct 2019 16:15:54 +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