On 05/20/2011 12:11 AM, Stefan Hajnoczi wrote:
On Thu, May 19, 2011 at 3:12 PM, Avi Kivity<avi@xxxxxxxxxx> wrote: > +struct MemoryRegion { > + /* All fields are private - violators will be prosecuted */ > + const MemoryRegionOps *ops; > + MemoryRegion *parent; In the case where a region is aliased (mapped twice into the address space at different addresses) I need two MemoryRegions?
Yes.
The MemoryRegion describes an actual mapping in the<parent, addr, ram_addr> tuple, not just the attributes of the region (ops, size, ...).
Correct. The region is not just a read-only descriptor. memory_region_add_subregion() can be used only once on a region (unless you _del_subregion() in between).
(it also follows from the fact that there is no separate opaque for registration, and from the fact that RAM is owned by the region, not provided as part of registration).
-- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html