Re: [PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 04:18:40PM -0500, Konrad Rzeszutek Wilk wrote: > .giant snip.. > > > + npinned = get_user_pages_fast(uaddr, npages, write, pages); > > > + if (npinned != npages) > > > + goto err; > > > + > > > > As I said I have doubts about the whole approach, but this > > impleme

Re: [PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address

2018-12-16 Thread Konrad Rzeszutek Wilk
.giant snip.. > > + npinned = get_user_pages_fast(uaddr, npages, write, pages); > > + if (npinned != npages) > > + goto err; > > + > > As I said I have doubts about the whole approach, but this > implementation in particular isn't a good idea > as it keeps the page around forever. >

Re: [PATCH net-next 0/3] vhost: accelerate metadata access through vmap()

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 06:10:19PM +0800, Jason Wang wrote: > Hi: > > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling. > > Test shows a

Re: [PATCH] vhost: correct the related warning message

2018-12-16 Thread Sergei Shtylyov
On 12/13/2018 06:21 PM, Michael S. Tsirkin wrote: >>> Fixes: 'commit d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression >>> + remove tf_subsystem")' >>> 'commit cbbd26b8b1a6 ("[iov_iter] new primitives - >>> copy_from_iter_full() and friends")' >> >> Fixes: d588cf8f618d ("target

Re: [PATCH] vhost: return EINVAL if iovecs size does not match the message size

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 05:53:50PM +0300, Pavel Tikhomirov wrote: > We've failed to copy and process vhost_iotlb_msg so let userspace at > least know about it. For instance before these patch the code below runs > without any error: > > int main() > { > struct vhost_msg msg; > struct iovec iov

Re: [PATCH net-next 1/3] vhost: generalize adding used elem

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 06:10:20PM +0800, Jason Wang wrote: > Use one generic vhost_copy_to_user() instead of two dedicated > accessor. This will simplify the conversion to fine grain accessors. > > Signed-off-by: Jason Wang The reason we did it like this is because it was faster. Want to try b

Re: [PATCH] drm/virtio: switch to generic fbdev emulation

2018-12-16 Thread Dave Airlie
On Thu, 13 Dec 2018 at 23:49, Gerd Hoffmann wrote: > > Signed-off-by: Gerd Hoffmann Seems correct to me, Reviewed-by: Dave Airlie ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/list

Re: [PATCH v2 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-16 Thread Stefan Hajnoczi
On Wed, Dec 12, 2018 at 05:25:50PM +0800, jiangyiwen wrote: > Now vsock only support send/receive small packet, it can't achieve > high performance. As previous discussed with Jason Wang, I revisit the > idea of vhost-net about mergeable rx buffer and implement the mergeable > rx buffer in vhost-vs

Re: [PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-16 Thread Stefan Hajnoczi
On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote: > +static struct virtio_vsock_pkt *receive_mergeable(struct virtqueue *vq, > + struct virtio_vsock *vsock, unsigned int *total_len) > +{ > + struct virtio_vsock_pkt *pkt; > + u16 num_buf; > + void *buf; > + unsi

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-16 Thread Stefan Hajnoczi
On Thu, Dec 13, 2018 at 11:08:04AM +0800, jiangyiwen wrote: > On 2018/12/12 23:37, Michael S. Tsirkin wrote: > > On Wed, Dec 12, 2018 at 05:29:31PM +0800, jiangyiwen wrote: > >> When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, > >> it will merge big packet into rx vq. > >> > >> Signed-off-by: Y

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-16 Thread Stefan Hajnoczi
On Thu, Dec 13, 2018 at 03:42:33PM +0800, jiangyiwen wrote: > On 2018/12/13 13:59, David Miller wrote: > > From: jiangyiwen > > Date: Thu, 13 Dec 2018 11:11:48 +0800 > > > >> I hope Host can fill fewer bytes into rx virtqueue, so > >> I keep structure virtio_vsock_mrg_rxbuf_hdr one byte > >> alig

Re: [PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 06:10:22PM +0800, Jason Wang wrote: > It was noticed that the copy_user() friends that was used to access > virtqueue metdata tends to be very expensive for dataplane > implementation like vhost since it involves lots of software check, > speculation barrier, hardware featur

Re: [PATCH net-next 0/3] vhost: accelerate metadata access through vmap()

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 06:10:19PM +0800, Jason Wang wrote: > Hi: > > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling. Userspace access

Re: [PATCH] vhost: correct the related warning message

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 12:05:31PM +0300, Sergei Shtylyov wrote: > On 13.12.2018 4:10, wangyan wrote: > > > Fixes: 'commit d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression > > + remove tf_subsystem")' > > 'commit cbbd26b8b1a6 ("[iov_iter] new primitives - > > copy_from_iter_fu

Re: [PATCH v2 5/5] VSOCK: batch sending rx buffer to increase bandwidth

2018-12-16 Thread Stefan Hajnoczi
On Wed, Dec 12, 2018 at 05:35:27PM +0800, jiangyiwen wrote: > Batch sending rx buffer can improve total bandwidth. > > Signed-off-by: Yiwen Jiang > --- Please send patches with git-send-email --thread --no-chain-reply-to so that your patch series email thread looks like this: * [PATCH 00/NN]

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 11:11:48AM +0800, jiangyiwen wrote: > On 2018/12/13 3:09, David Miller wrote: > > From: jiangyiwen > > Date: Wed, 12 Dec 2018 17:29:31 +0800 > > > >> diff --git a/include/uapi/linux/virtio_vsock.h > >> b/include/uapi/linux/virtio_vsock.h > >> index 1d57ed3..2292f30 100644

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 11:08:04AM +0800, jiangyiwen wrote: > On 2018/12/12 23:37, Michael S. Tsirkin wrote: > > On Wed, Dec 12, 2018 at 05:29:31PM +0800, jiangyiwen wrote: > >> When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, > >> it will merge big packet into rx vq. > >> > >> Signed-off-by: Y

Re: [PATCH net V3 0/3] Fix various issue of vhost

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 10:53:36AM +0800, Jason Wang wrote: > Hi: > > This series tries to fix various issues of vhost: > > - Patch 1 adds a missing write barrier between used idx updating and > logging. > - Patch 2-3 brings back the protection of device IOTLB through vq > mutex, this fixes p

Re: [PATCH net V2 4/4] vhost: log dirty page correctly

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 10:39:41AM +0800, Jason Wang wrote: > > On 2018/12/12 下午10:32, Michael S. Tsirkin wrote: > > On Wed, Dec 12, 2018 at 06:08:19PM +0800, Jason Wang wrote: > > > Vhost dirty page logging API is designed to sync through GPA. But we > > > try to log GIOVA when device IOTLB is en

Re: [PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2018 at 10:38:09AM +0800, jiangyiwen wrote: > Hi Michael, > > On 2018/12/12 23:31, Michael S. Tsirkin wrote: > > On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote: > >> Guest receive mergeable rx buffer, it can merge > >> scatter rx buffer into a big buffer and then copy >

Re: [PATCH] kbuild, x86: revert macros in extended asm workarounds

2018-12-16 Thread Borislav Petkov via Virtualization
On Sun, Dec 16, 2018 at 02:33:39AM +, Nadav Amit wrote: > In general, I think that from the start it was clear that the motivation for > the patch-set is not just performance and also better code. For example, I > see no reason to revert the PV-changes or the lock-prefix changes that > improved

Re: [PATCH v6 0/7] Add virtio-iommu driver

2018-12-16 Thread Christoph Hellwig
On Thu, Dec 13, 2018 at 12:50:29PM +, Jean-Philippe Brucker wrote: > * DMA ops for x86 (see "HACK" commit). I'd like to use dma-iommu but I'm > not sure how to implement the glue that sets dma_ops properly. http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-iommu-ops _