Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-18 Thread Dr. David Alan Gilbert
* Michael S. Tsirkin (m...@redhat.com) wrote: > On Thu, Dec 14, 2017 at 04:27:31PM +0100, Igor Mammedov wrote: > > Also it seems that we have a race in current code where > > region_del() unrefs memory region first and then by the > > commit time memory region could be gone since old flatview > >

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-15 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 15/12/2017 14:30, Dr. David Alan Gilbert wrote: > >> Also it seems that we have a race in current code where > >> region_del() unrefs memory region first and then by the > >> commit time memory region could be gone since old flatview > >> is

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-15 Thread Paolo Bonzini
On 15/12/2017 14:30, Dr. David Alan Gilbert wrote: >> Also it seems that we have a race in current code where >> region_del() unrefs memory region first and then by the >> commit time memory region could be gone since old flatview >> is unreffed before commit callback is called, but guest still >>

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-15 Thread Dr. David Alan Gilbert
* Igor Mammedov (imamm...@redhat.com) wrote: > On Wed, 13 Dec 2017 18:08:05 + > "Dr. David Alan Gilbert (git)" wrote: > > > From: "Dr. David Alan Gilbert" > > > > As regions are reported by the listener to the _nop and _add > > methods, add them to

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-14 Thread Michael S. Tsirkin
On Thu, Dec 14, 2017 at 04:27:31PM +0100, Igor Mammedov wrote: > Also it seems that we have a race in current code where > region_del() unrefs memory region first and then by the > commit time memory region could be gone since old flatview > is unreffed before commit callback is called, but guest

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-14 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 13/12/2017 19:08, Dr. David Alan Gilbert (git) wrote: > > +if (dev->tmp_mem->nregions) { > > +/* Since we already have at least one region, lets see if > > + * this extends it; since we're scanning in order, we only > > +

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-14 Thread Igor Mammedov
On Wed, 13 Dec 2017 18:08:05 + "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > As regions are reported by the listener to the _nop and _add > methods, add them to our new temporary list. > Regions that abut can be merged

Re: [Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-13 Thread Paolo Bonzini
On 13/12/2017 19:08, Dr. David Alan Gilbert (git) wrote: > +if (dev->tmp_mem->nregions) { > +/* Since we already have at least one region, lets see if > + * this extends it; since we're scanning in order, we only > + * have to look at the last one, and the FlatView that

[Qemu-devel] [PATCH v4 4/6] vhost: add regions to temporary list

2017-12-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" As regions are reported by the listener to the _nop and _add methods, add them to our new temporary list. Regions that abut can be merged if the backend allows. Signed-off-by: Dr. David Alan Gilbert ---