From: Scott Wood <scottwood@freescale.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-ppc@nongnu.org list:PowerPC" <qemu-ppc@nongnu.org>,
Alexander Graf <agraf@suse.de>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] [RFC ppc-next PATCH 3/6] memory: add memory_region_to_address()
Date: Fri, 22 Mar 2013 17:05:13 -0500 [thread overview]
Message-ID: <1363989913.24790.10@snotra> (raw)
In-Reply-To: <CAFEAcA_YegTw77bNH9udFCpk15p-osuwWpjQDphRqTw19cdcZw@mail.gmail.com> (from peter.maydell@linaro.org on Fri Mar 22 08:08:57 2013)
On 03/22/2013 08:08:57 AM, Peter Maydell wrote:
> On 21 March 2013 22:43, Scott Wood <scottwood@freescale.com> wrote:
> > What if the update is to a parent memory region, not to the one
> directly
> > associated with the device?
> >
> > Or does add() get called for all child regions (recursively) in
> such cases?
>
> The memory API flattens the tree of memory regions down into a flat
> view of the address space. These callbacks get called for the
> final flattened view (so you'll never see a pure container in the
> callback, only leaves). The callbacks happen for every region which
> appears in the address space, in linear order. When an update happens
> memory.c identifies the changes between the old flat view and the
> new one and calls callbacks appropriately.
OK, so .add and .del will be sufficient to capture any manipulation
that would affect whether and where the region we care about is mapped?
> This code isn't the
> first use of the memory API listeners, so it's all well-tested code.
Sure, I'm not suggesting the code doesn't work -- just trying to
understand how, so I know I'm using it properly. The implementation is
a bit opaque (to me at least), and the listener callbacks aren't
documented the way the normal API functions are.
> >> However, maybe with a bit of brainstorming we could come up with a
> >> reasonably generic scheme.
>
> > In the kernel API? Or do you mean a generic scheme within QEMU
> that encodes
> > any reasonably expected mechanism for setting the device adress
> (e.g. assume
> > that it is either a 64-bit attribute, or uses the legacy ARM API),
> or
> > perhaps a callback into device code?
> >
> > The MPIC's memory listener isn't that much code... I'm not sure
> > there's a great need for a central KVM registry.
>
> Well, nor is the ARM memory listener, but why have two bits of
> code doing the same thing when you could have one?
They're not doing quite the same thing, though, and the effort required
to unify them is non-zero. The two main issues are the way that the
address is communicated to KVM, and the ability to change the mapping
after the guest starts.
-Scott
next prev parent reply other threads:[~2013-03-22 22:06 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 [this message]
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
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=1363989913.24790.10@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).