On Mon, Jul 10, 2017 at 05:09:25PM +0200, Paolo Bonzini wrote:
> 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.The constraints need to be documented. Someone might try to use blk_dma_map() and waste time debugging poor performance in the future. Stefan
signature.asc
Description: PGP signature
