qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 20/23] vhost: avoid cpu_get_physical_page_desc()


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 20/23] vhost: avoid cpu_get_physical_page_desc()
Date: Thu, 22 Dec 2011 14:49:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

On 12/22/2011 02:48 PM, Michael S. Tsirkin wrote:
> 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?

I thought about it, it makes sense.

We even have memory_region_find() which can be used to implement it,
just need a FOR_EACH wrapper.

-- 
error compiling committee.c: too many arguments to function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]