Re: lkvm: virtio-net-rx general protection error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <asias.hejun@xxxxxxxxx>
> 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 <asias.hejun@xxxxxxxxx>
> ---
>  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 <milon@xxxxx>

Many thanks.

-- 
Milan Kocian
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux