From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdi2z-00085Q-Bm for qemu-devel@nongnu.org; Thu, 22 Dec 2011 07:47:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rdi2y-00051B-AK for qemu-devel@nongnu.org; Thu, 22 Dec 2011 07:46:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdi2y-000513-3a for qemu-devel@nongnu.org; Thu, 22 Dec 2011 07:46:56 -0500 Date: Thu, 22 Dec 2011 14:48:48 +0200 From: "Michael S. Tsirkin" Message-ID: <20111222124848.GA25538@redhat.com> References: <1324304024-11220-1-git-send-email-avi@redhat.com> <1324304024-11220-21-git-send-email-avi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1324304024-11220-21-git-send-email-avi@redhat.com> Subject: Re: [Qemu-devel] [PATCH 20/23] vhost: avoid cpu_get_physical_page_desc() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, Stefano Stabellini On Mon, Dec 19, 2011 at 04:13:41PM +0200, Avi Kivity wrote: > @@ -871,7 +899,10 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev) > hdev->vqs + i, > i); > } > - vhost_sync_dirty_bitmap(hdev, 0, (target_phys_addr_t)~0x0ull); > + for (i = 0; i < hdev->n_mem_sections; ++i) { > + vhost_sync_dirty_bitmap(hdev, &hdev->mem_sections[i], > + 0, (target_phys_addr_t)~0x0ull); > + } > r = vdev->binding->set_guest_notifiers(vdev->binding_opaque, false); > if (r < 0) { > fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", r); > diff --git a/hw/vhost.h b/hw/vhost.h > index d1824ec..80e64df 100644 > --- a/hw/vhost.h > +++ b/hw/vhost.h > @@ -30,6 +30,8 @@ struct vhost_dev { > MemoryListener memory_listener; > int control; > struct vhost_memory *mem; > + int n_mem_sections; > + MemoryRegionSection *mem_sections; > struct vhost_virtqueue *vqs; > int nvqs; > unsigned long long features; This adds need to track all sections which is unfortunate. Couldn't the memory API get an extension e.g. to scan them all? > -- > 1.7.7.1