[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [RFC PATCH v2 3/6] memory: add memory_region
From: |
Peter Maydell |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [RFC PATCH v2 3/6] memory: add memory_region_to_address() |
Date: |
Tue, 16 Apr 2013 09:25:50 +0100 |
On 16 April 2013 00:19, Scott Wood <address@hidden> wrote:
> This is useful for when a user of the memory region API needs to
> communicate the absolute bus address to something outside QEMU
> (in particular, KVM).
>
> Signed-off-by: Scott Wood <address@hidden>
> ---
> TODO: Use add/del memory listeners later in the patchset, which would
> eliminate the need for this patch.
Yes, please do.
> +/* memory_region_to_address: Find the full address of the start of the
> + * given #MemoryRegion, ignoring aliases. There is no guarantee
> + * that the #MemoryRegion is actually visible at this address, if
> + * there are overlapping regions.
> + *
> + * @mr: #MemoryRegion being queried
> + * @asp: if non-NULL, returns the #AddressSpace @mr is mapped in, if any
> + */
> +hwaddr memory_region_to_address(MemoryRegion *mr, AddressSpace **asp);
A MemoryRegion can appear in more than one AddressSpace (or none at all),
so I don't think this is a very clearly defined API to put in the
memory API itself. (It's ok to make that kind of assumption as a user
of the memory APIs for particular cases, eg in how a memory listener
callback function behaves. But we shouldn't be baking those assumptions
into new API functions.)
thanks
-- PMM
- [Qemu-ppc] [RFC PATCH v2 0/6] kvm/openpic: in-kernel irqchip, Scott Wood, 2013/04/15
- [Qemu-ppc] [RFC PATCH v2 1/6] kvm: update linux-headers, Scott Wood, 2013/04/15
- [Qemu-ppc] [RFC PATCH v2 4/6] openpic: factor out some common defines into openpic.h, Scott Wood, 2013/04/15
- [Qemu-ppc] [RFC PATCH v2 5/6] PPC: e500: factor out mpic init code, Scott Wood, 2013/04/15
- [Qemu-ppc] [RFC PATCH v2 6/6] kvm/openpic: in-kernel mpic support, Scott Wood, 2013/04/15