qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 4/6] block/nvme: Implement .bdrv_dma_map and


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 4/6] block/nvme: Implement .bdrv_dma_map and .bdrv_dma_unmap
Date: Mon, 10 Jul 2017 17:09:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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