From: Milan Kocian Subject: Re: lkvm: virtio-net-rx general protection error Date: Mon, 28 Oct 2013 17:33:19 +0100 Message-ID: <20131028163319.GA21573@ntm.wq.cz> References: <20131021113528.GA657@ntm.wq.cz> <52651BA3.8030501@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pekka Enberg , KVM , Asias He , Sasha Levin , Cyrill Gorcunov To: Asias He Return-path: Received: from srw1.wq.cz ([80.92.240.241]:35001 "EHLO srw1.wq.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756704Ab3J1RBM (ORCPT ); Mon, 28 Oct 2013 13:01:12 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: hello, On Mon, Oct 28, 2013 at 04:28:57PM +0800, Asias He wrote: > > Hello Milan, > > Does the attached patch fix your problem? > > -- > Asias > From b48eaeff7250bf7476c771e82cdbf20c3e85c4c9 Mon Sep 17 00:00:00 2001 > From: Asias He > Date: Mon, 28 Oct 2013 15:02:54 +0800 > Subject: [PATCH 1/1] kvm-tools: Fix virtio-net iov memcpy > > We should skip copied bytes from the buffer not from the iov itself > which memcpy_toiovecend does. > > Signed-off-by: Asias He > --- > tools/kvm/virtio/net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c > index 2c34996..3715aaf 100644 > --- a/tools/kvm/virtio/net.c > +++ b/tools/kvm/virtio/net.c > @@ -114,7 +114,7 @@ static void *virtio_net_rx_thread(void *p) > while (copied < len) { > size_t iovsize = min(len - copied, iov_size(iov, in)); > > - memcpy_toiovecend(iov, buffer, copied, iovsize); > + memcpy_toiovec(iov, buffer + copied, iovsize); > copied += iovsize; > if (has_virtio_feature(ndev, VIRTIO_NET_F_MRG_RXBUF)) > hdr->num_buffers++; > -- > 1.8.3.1 > Excellent, this patch fixes the problem. Feel free to add: Tested-by: Milan Kocian Many thanks. -- Milan Kocian