On 28.02.20 22:01, Peter Xu wrote: > On Fri, Feb 28, 2020 at 09:16:28PM +0100, David Hildenbrand wrote: >> > > [...] > >>>> @@ -631,7 +658,7 @@ int qemu_vfio_dma_map(QEMUVFIOState *s, void *host, >>>> size_t size, >>>> qemu_vfio_remove_mapping(s, mapping); >>>> goto out; >>>> } >>>> - s->low_water_mark += size; >>>> + s->low_water_mark += max_size; >>> >>> I think it's fine to only increase the low water mark here, however >>> imo it would be better to also cache the max size in IOVAMapping too, >>> then in resize() we double check new_size <= max_size? It also makes >>> IOVAMapping more self contained. >>> >> >> I‘ll have a look how much additional code that will imply - if it‘s simple, >> I‘ll do it. > > AFAICT it'll be as simple as introducing IOVAMapping.max_size, then > pass max_size into qemu_vfio_add_mapping(). Thanks, >
Yeah, was answering from my mobile without code at hand :) added! Thanks! -- Thanks, David / dhildenb