qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/5] vfio: Move container list to DMAContext


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 4/5] vfio: Move container list to DMAContext
Date: Thu, 25 Apr 2013 16:35:58 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Apr 24, 2013 at 09:12:39AM -0600, Alex Williamson wrote:
> On Wed, 2013-04-24 at 22:01 +1000, David Gibson wrote:
> > At the moment, vfio maintains a global list of containers that are assumed
> > to be more or less interchangeable, since they are all set up with a
> > MemoryListener to have all of system memory mapped.  However, that only
> > makes sense if all the containers are used on devices which really do
> > expect a dma address space identical to system memory.
> > 
> > This patch moves towards that by making the list of containers per
> > DMAContext (which corresponds to a dma address space) instead of global.
> 
> This seems like an unnecessary intrusion into common code.  Why not
> create a vfio specific list of dma objects, each with a list of
> containers?  Thanks,

Possible, but ugly.  DMAContext *is* the handle for a DMA address
space.  Having a parallel array of VFIO contextns would be converting
from the generic handle to the VFIO one would be a search, rather than
just a dereference, and making sure the lifetime of the VFIO one
matches the lifetime of the generic object would be unnecessarily
awkward.

Which reminds me, I forgot to implement a VFIO hook for DMAContext
destruction in this patch.  That does need to be fixed.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: Digital signature


reply via email to

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