From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH] kvm: qemu: virtio: enable VIRTIO_ZERO_COPY Date: Thu, 11 Dec 2008 09:36:59 +0000 Message-ID: <1228988219.7968.5.camel@blaa> References: <1228325221-18106-1-git-send-email-aliguori@us.ibm.com> <1228325221-18106-2-git-send-email-aliguori@us.ibm.com> <1228325221-18106-3-git-send-email-aliguori@us.ibm.com> <1228325221-18106-4-git-send-email-aliguori@us.ibm.com> <1228325221-18106-5-git-send-email-aliguori@us.ibm.com> <1228325221-18106-6-git-send-email-aliguori@us.ibm.com> <1228325221-18106-7-git-send-email-aliguori@us.ibm.com> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Anthony Liguori To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39749 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753641AbYLKJi3 (ORCPT ); Thu, 11 Dec 2008 04:38:29 -0500 In-Reply-To: <1228325221-18106-7-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2008-12-03 at 11:27 -0600, Anthony Liguori wrote: > In the absence of a zero-copy API, we cannot touch physical memory directly. > This patch introduces a #define to control whether we touch buffers directly, > or bounce the buffers through cpu_physical_memory_rw. > > The #define is needed for merging virtio into upstream QEMU since zero-copy will > not be accepted as-is. As a bonus, I also added physical memory dirtying > support to the zero-copy case so now live migration should work when using > virtio. > > With this patch, virtio is mergable into upstream QEMU (except for virtio-net, > that's a different series though). > > Signed-off-by: Anthony Liguori > > diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c > index 1a58940..9396580 100644 > --- a/qemu/hw/virtio.c > +++ b/qemu/hw/virtio.c > @@ -17,6 +17,8 @@ > #include "virtio.h" > #include "sysemu.h" > > +//#define VIRTIO_ZERO_COPY > + From: Mark McLoughlin Subject: [PATCH] kvm: qemu: virtio: enable VIRTIO_ZERO_COPY Anthony intended to enable VIRTIO_ZERO_COPY before submitting, so do that now. Fixes an oops in the bounce buffer malloc in virtqueue_pop() I have seen twice so far. We still need to track this down, but it's very hard to reproduce. Signed-off-by: Mark McLoughlin --- qemu/hw/virtio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c index 16356e8..1d06fcc 100644 --- a/qemu/hw/virtio.c +++ b/qemu/hw/virtio.c @@ -16,7 +16,7 @@ #include "virtio.h" #include "sysemu.h" -//#define VIRTIO_ZERO_COPY +#define VIRTIO_ZERO_COPY /* from Linux's linux/virtio_pci.h */ -- 1.5.4.3