qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH v2 3/6] memory: add memory_region_to_address()
Date: Tue, 16 Apr 2013 19:10:48 -0500	[thread overview]
Message-ID: <1366157448.23030.25@snotra> (raw)
In-Reply-To: <CAFEAcA_pgAOBApXWh6BA_EGrDG16Yp9=EUc_SR_nJujX3qWP0g@mail.gmail.com> (from peter.maydell@linaro.org on Tue Apr 16 03:25:50 2013)

On 04/16/2013 03:25:50 AM, Peter Maydell wrote:
> On 16 April 2013 00:19, Scott Wood <scottwood@freescale.com> 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 <scottwood@freescale.com>
> > ---
> > TODO: Use add/del memory listeners later in the patchset, which  
> would
> > eliminate the need for this patch.
> 
> Yes, please do.

I will.  Alex wanted a respun patchset to work with the latest kernel  
API, and I didn't have a chance to address this yet.  It's still RFC.

> > +/* 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.)

I'm not sure how it's different from memory_region_to_address_space in  
that regard, other than its ability to gracefully handle the "or none  
at all" case.

How does it work to be in more than one AddressSpace, if there's a  
parent chain?  More than one "as" with the same "as->root"?  Or are you  
referring to aliases?

-Scott

  reply	other threads:[~2013-04-17  0:11 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1360823521-32306-1-git-send-email-scottwood@freescale.com>
     [not found] ` <1360823521-32306-3-git-send-email-scottwood@freescale.com>
2013-03-21  8:30   ` [Qemu-devel] [RFC ppc-next PATCH 2/6] kvm: hw/kvm is not x86-specific Alexander Graf
     [not found] ` <1360823521-32306-4-git-send-email-scottwood@freescale.com>
2013-03-21  8:31   ` [Qemu-devel] [RFC ppc-next PATCH 3/6] memory: add memory_region_to_address() Alexander Graf
2013-03-21 10:53     ` Peter Maydell
2013-03-21 10:59       ` Alexander Graf
2013-03-21 11:01         ` Peter Maydell
2013-03-21 11:05           ` Alexander Graf
2013-03-21 11:09             ` Peter Maydell
2013-03-21 11:14               ` Alexander Graf
2013-03-21 11:22                 ` Peter Maydell
2013-03-21 11:29                   ` Alexander Graf
2013-03-21 11:32                     ` Peter Maydell
2013-03-21 11:38                       ` Alexander Graf
2013-03-21 11:44                         ` Peter Maydell
2013-03-21 11:49                           ` Alexander Graf
2013-03-21 11:51                             ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2013-03-21 22:43                               ` Scott Wood
2013-03-22 13:08                                 ` Peter Maydell
2013-03-22 22:05                                   ` Scott Wood
2013-03-23 11:24                                     ` Peter Maydell
2013-03-25 18:23                                       ` Scott Wood
2013-03-21 11:53                             ` [Qemu-devel] " Peter Maydell
     [not found] ` <1360823521-32306-6-git-send-email-scottwood@freescale.com>
2013-03-21  8:34   ` [Qemu-devel] [RFC ppc-next PATCH 5/6] kvm: export result of irqchip config check Alexander Graf
2013-03-21  8:45     ` Jan Kiszka
2013-03-21  8:50       ` Alexander Graf
     [not found] ` <1360823521-32306-7-git-send-email-scottwood@freescale.com>
2013-03-21  8:41   ` [Qemu-devel] [RFC ppc-next PATCH 6/6] kvm/openpic: in-kernel mpic support Alexander Graf
2013-03-21 20:50     ` Scott Wood
2013-03-21 21:29       ` Alexander Graf
2013-03-21 21:59         ` Scott Wood
2013-03-21 23:45           ` Alexander Graf
2013-03-22 22:51             ` Scott Wood
2013-04-15 23:19 ` [Qemu-devel] [RFC PATCH v2 0/6] kvm/openpic: in-kernel irqchip Scott Wood
2013-04-15 23:19   ` [Qemu-devel] [RFC PATCH v2 1/6] kvm: update linux-headers Scott Wood
2013-04-15 23:19   ` [Qemu-devel] [RFC PATCH v2 2/6] kvm: use hw/kvm/Makefile.objs consistently for all relevant architectures Scott Wood
2013-04-15 23:19   ` [Qemu-devel] [RFC PATCH v2 3/6] memory: add memory_region_to_address() Scott Wood
2013-04-16  8:25     ` Peter Maydell
2013-04-17  0:10       ` Scott Wood [this message]
2013-04-17  9:14         ` Peter Maydell
2013-04-15 23:19   ` [Qemu-devel] [RFC PATCH v2 4/6] openpic: factor out some common defines into openpic.h Scott Wood
2013-04-15 23:19   ` [Qemu-devel] [RFC PATCH v2 5/6] PPC: e500: factor out mpic init code Scott Wood
2013-04-15 23:19   ` [Qemu-devel] [RFC PATCH v2 6/6] kvm/openpic: in-kernel mpic support Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366157448.23030.25@snotra \
    --to=scottwood@freescale.com \
    --cc=agraf@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).