On Tue, Apr 30, 2013 at 09:30:12AM +0200, Paolo Bonzini wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Il 30/04/2013 04:23, David Gibson ha scritto:
> >>> I think this is a different problem.  Basically the question is
> >>> "what happens if a MemoryRegion 'disappears' while an
> >>> AddressSpace is still referring to it", and the answer right
> >>> now is "badness".
> >> 
> >> Well.. no.  The same problem may well exist for AddressSpace
> >> objects, but in this case it's for the VFIO private
> >> per-address-space object.
> 
> Well, once we clarify the lifetime of AddressSpaces, we can clarify
> the lifetime of the VFIO private object.

Hrm.  I don't see why.  The VFIO private data is tied to the
MemoryRegion, not an AddressSpace since that's what represents the
iommu.

> >>> We should look at generic fixes before dropping hooks in the
> >>> code.  At the very least an "assert(mr->parent == NULL);" is
> >>> missing in memory_region_destroy.
> >> 
> >> Well, sure that's probably also a good idea.  But the whole point
> >> here is you're insisting that the MemoryRegion code doesn't know
> >> about the vfio private data, even as an opaque handle, and so
> >> there's no possible assert we can put there to check it has been
> >> destroyed.
> > 
> > Oh, yes, forgot to ask.  I'm still unclear on what the conceptual 
> > difference is supposed to between a MemoryRegion and an
> > AddressSpace. AFAICT AddressSpace seems to be roughly just a
> > wrapper on a MemoryRegion that gives it some more features.
> 
> Yes, an AddressSpace is a wrapper for a MemoryRegion that has a NULL
> - ->parent, with two extra features:
> 
> - - QEMU computes the "flat" view of the MemoryRegion and a compressed
> radix tree representation of that view

Ok.  It's not clear to me what that means in practice.

-- 
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