[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: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 4/6] block/nvme: Implement .bdrv_dma_map and .bdrv_dma_unmap |
Date: |
Tue, 11 Jul 2017 11:04:44 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
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