From: Avi Kivity <avi@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
"Michal Simek" <monstr@monstr.eu>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Peter Crosthwaite" <peter.crosthwaite@petalogix.com>,
"Paul Brook" <paul@codesourcery.com>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Andreas Färber" <afaerber@suse.de>,
"John Williams" <john.williams@petalogix.com>
Subject: Re: [Qemu-devel] [RFC] QOMification of AXI stream
Date: Tue, 12 Jun 2012 16:48:39 +0300 [thread overview]
Message-ID: <4FD748B7.20803@redhat.com> (raw)
In-Reply-To: <CAFEAcA_wmkq8iqoJ_YD2CnqToj=Zo59cgd427kRqqt3wNSubTA@mail.gmail.com>
On 06/12/2012 04:32 PM, Peter Maydell wrote:
> On 12 June 2012 14:18, Avi Kivity <avi@redhat.com> wrote:
>> On 06/12/2012 03:58 PM, Peter Maydell wrote:
>>> On 11 June 2012 18:31, Avi Kivity <avi@redhat.com> wrote:
>>>> On 06/11/2012 06:01 PM, Anthony Liguori wrote:
>>>>> Perhaps we should just make MemoryRegion work in both directions?
>>>
>>>> The other direction is currently cpu_physical_memory_rw(). We do need
>>>> to support issuing transactions from arbitrary points in the memory
>>>> hierarchy, but I don't think a device's MemoryRegion is the right
>>>> interface. Being able to respond to memory transactions, and being able
>>>> to issue them are two different things.
>>>
>>> ...they're just opposite sides of the same interface, though,
>>> really. For instance you could say that any memory transaction
>>> master (cpu, dma controller, whatever) should take a single
>>> MemoryRegion* and must issue all its memory accesses to that MR*.
>>> (obviously that would usually be a container region.)
>>
>> It would be a container region, and it would be unrelated to any other
>> regions held by the device (the device might not have any memory
>> regions; instead it would only be able to do dma).
>
> It shouldn't actually be owned by the transaction master, but
> by whatever the parent object is that created the transaction
> master. So for instance for an ARM board you'd have something
> like:
> * top level machine QOM object creates a 'system-memory'
> container region, and puts all the devices in it in their
> correct locations
> * top level object also creates the cortex-a9 device, and
> passes it a pointer to the system-memory container
> * the cortex-a9 device instantiates the CPU cores and the
> per-cpu devices, and creates a container region for
> each cpu containing (devices for that cpu, plus the
> system-memory region it got passed). It passes a pointer
> to the right region to each cpu core
> * the cpu cores just use the region they're given
> * if there's a dma controller in the system, the top level
> machine object creates the controller and hands it a
> pointer to the system-memory container region too. (So
> the dma controller correctly doesn't see the per-cpu
> devices.)
>
> (when I say 'passes a pointer' I mean something involving
> QOM links I expect. I'm not sure if anybody's thought about
> how we expose memory regions in a QOM manner.)
>
> Notice that in this approach it's perfectly valid to have
> a board model which creates a single device and a single
> CPU and passes the device's MemoryRegion directly to the
> CPU. This corresponds to a hardware design where the CPU's
> address lines just connect straight to the device's, ie
> there's no bus fabric or address decoding.
Yes, exactly.
If the devices sees a byte-swapping bus, then instead of giving it a
container region, we give it an io region; the callbacks byte-swap and
write the contents to a container that does the rest of the forwarding.
If it's an address remapping iommu, then we pass it a container region
with an alias-per-page that remaps the device addresses to addresses in
another container:
iommu
|
+-alias-page-0 ---> system_memory[7]
|-alias-page-1 ---> system_memory[3]
.
.
.
So a device write to page 1 is redirected to page 3. Of course in both
cases we'll want to fold the functionality into the memory API instead
of making the iommu writer work so hard.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-06-12 13:49 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 4:23 [Qemu-devel] [RFC] QOMification of AXI stream Peter Crosthwaite
2012-06-08 9:13 ` Paul Brook
2012-06-08 9:34 ` Peter Maydell
2012-06-08 13:13 ` Paul Brook
2012-06-08 13:39 ` Anthony Liguori
2012-06-08 13:59 ` Paul Brook
2012-06-08 14:17 ` Anthony Liguori
2012-06-08 13:41 ` Anthony Liguori
2012-06-08 13:53 ` Paul Brook
2012-06-08 13:55 ` Peter Maydell
2012-06-08 9:45 ` Andreas Färber
2012-06-09 1:53 ` Peter Crosthwaite
2012-06-09 2:12 ` Andreas Färber
2012-06-09 3:28 ` Peter Crosthwaite
2012-06-11 5:54 ` Paolo Bonzini
2012-06-11 13:05 ` Peter Maydell
2012-06-11 13:17 ` Anthony Liguori
2012-06-11 13:41 ` Paolo Bonzini
2012-06-08 14:15 ` Anthony Liguori
2012-06-09 1:24 ` Peter Crosthwaite
2012-06-11 13:15 ` Anthony Liguori
2012-06-11 13:39 ` Peter Maydell
2012-06-11 14:38 ` Edgar E. Iglesias
2012-06-11 14:53 ` Peter Maydell
2012-06-11 14:58 ` Edgar E. Iglesias
2012-06-11 15:03 ` Anthony Liguori
2012-06-11 15:34 ` Peter Maydell
2012-06-11 15:56 ` Edgar E. Iglesias
2012-06-12 0:33 ` Peter Crosthwaite
2012-06-12 7:58 ` Edgar E. Iglesias
2012-06-14 1:01 ` Peter Crosthwaite
2012-06-11 15:01 ` Anthony Liguori
2012-06-11 17:31 ` Avi Kivity
2012-06-11 18:35 ` Anthony Liguori
2012-06-11 22:00 ` [Qemu-devel] [RFC] QOMification of AXI streams Benjamin Herrenschmidt
2012-06-11 22:29 ` Anthony Liguori
2012-06-11 23:46 ` Benjamin Herrenschmidt
2012-06-12 1:33 ` Anthony Liguori
2012-06-12 2:06 ` Benjamin Herrenschmidt
2012-06-12 9:46 ` Avi Kivity
2012-06-13 0:37 ` Benjamin Herrenschmidt
2012-06-13 20:57 ` Anthony Liguori
2012-06-13 21:25 ` Benjamin Herrenschmidt
2012-06-14 0:00 ` Edgar E. Iglesias
2012-06-14 1:34 ` Benjamin Herrenschmidt
2012-06-14 2:03 ` Edgar E. Iglesias
2012-06-14 2:16 ` Benjamin Herrenschmidt
2012-06-14 2:31 ` Edgar E. Iglesias
2012-06-14 2:41 ` Benjamin Herrenschmidt
2012-06-14 3:17 ` Edgar E. Iglesias
2012-06-14 3:43 ` Benjamin Herrenschmidt
2012-06-14 5:16 ` Benjamin Herrenschmidt
2012-06-12 1:04 ` Andreas Färber
2012-06-12 2:42 ` Benjamin Herrenschmidt
2012-06-12 9:31 ` [Qemu-devel] [RFC] QOMification of AXI stream Avi Kivity
2012-06-12 9:42 ` Edgar E. Iglesias
2012-06-11 18:36 ` Anthony Liguori
2012-06-12 9:51 ` Avi Kivity
2012-06-12 12:58 ` Peter Maydell
2012-06-12 13:18 ` Avi Kivity
2012-06-12 13:32 ` Peter Maydell
2012-06-12 13:48 ` Avi Kivity [this message]
2012-06-12 13:55 ` Andreas Färber
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=4FD748B7.20803@redhat.com \
--to=avi@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=edgar.iglesias@gmail.com \
--cc=john.williams@petalogix.com \
--cc=monstr@monstr.eu \
--cc=paul@codesourcery.com \
--cc=peter.crosthwaite@petalogix.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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).