On 10/07/2017 16:59, Stefan Hajnoczi wrote: >> +static void nvme_dma_map(BlockDriverState *bs, void *host, size_t size) >> +{ >> + BDRVNVMeState *s = bs->opaque; >> + >> + nvme_vfio_dma_map(s->vfio, host, size, false, NULL); > Since temporary=false repeated calls to map/unmap will run out of space > and stop working after some time?
Yes, the point of bdrv_dma_map/unmap is to add a permanent mapping. Temporary mappings are only valid inside nvme.c, because the corresponding iova is not recorded anywhere. Instead, bdrv_dma_map/unmap cache the iova just like we do for RAMBlock areas during system emulation. The solution is simply not to do that, just like img_bench only calls map/unmap once. If it happens, things just become slower as the driver falls back to temporary mappings. Paolo
signature.asc
Description: OpenPGP digital signature