qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Anthony Liguori" <aliguori@us.ibm.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"Peter Crosthwaite" <peter.crosthwaite@petalogix.com>,
	"Michal Simek" <monstr@monstr.eu>, "Avi Kivity" <avi@redhat.com>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	"Andreas Färber" <afaerber@suse.de>,
	"John Williams" <john.williams@petalogix.com>,
	"Paul Brook" <paul@codesourcery.com>
Subject: Re: [Qemu-devel] [RFC] QOMification of AXI streams
Date: Thu, 14 Jun 2012 11:34:10 +1000	[thread overview]
Message-ID: <1339637650.9220.134.camel@pasglop> (raw)
In-Reply-To: <20120614000001.GA26263@zapo>

On Thu, 2012-06-14 at 02:00 +0200, Edgar E. Iglesias wrote:
> 
> TBH, I don't understand any of the "upstream" access discussion nor
> the specifics of DMA accesses for the memory/system bus accesses.
> 
> When a device, like a DMA unit accesses the memory/system bus it,
> AFAIK, does it from a different port (its master port). That port is
> NOT the same as it's slave port.

It may or may not be but yes, in most case the slave and master
interfaces can be seen as different interfaces to the bus though in many
case they aren't completely independent (there are ordering guarantees
in some cases for example).

>  There is no reverese decoding of the
> addresses, the access is made top-down. If you are talking about NoCs
> we need a compleet different infrastructure but I don't think that
> is the case.

I don't parse the above. But the simple example is to look at PCI.

When a PCI device initiates an access, what happens is that it gets
arbitration on its bus segment, and from there it's purely an ordinary
PCI access for the address specified by that device.

Depending on other devices, bridges, etc... that access may travel
upstream or to a sibling (which can be a bridge and thus go back down)
etc...

Along that hierarchy, transforms might occur, which can be different
depending on the direction. For example the PCI host controller might
contain an iommu (typically that's the case with IBM pseries one) while
on the downstream direction it has a handful of relatively fixed
windows.

But there are other cases, the processor bus can be bridged to some
other IO bus (PLB4, PLB6, AXI) which can itself be bridge to some other
simpler bus (OPB, AHB, ...) and in some case there can be transforms
done along the way. Some may and some may not support DMA, or with
address limitation, etc... there's a bit of everything out there.

> I agree with Avi, most of it is already in place.

Well, not quite in that we need to traverse the memory hierarchy
starting from the device itself and have rules at the various "bridge"
levels on how to forward/transform things in the upstream direction
(though as the discussion showed earlier, we could use some better
support for downstream transforms as well).

I think we can probably stick to a mechanism that has two basic
function:

 - Either the transform (or lack of) can be represented by an offset to
be applied to the address (which would match most of the bit
mask/replace cases)

 - Or the transform is a function pointer

The former would represent most cases and would provide the ability to
"flatten the tree" by storing fully transformed ranges from the CPU
point of view (it might be tricky to have a variant of these for every
device) in order to speed up accesses. The latter would typically be
used by iommu's.

Now if you guys think you can cook up the necessary infrastructure
changes in the next couple of weeks, I'm happy to completely drop
DMAContext.

In any case, better accessors are a good thing so I'll start with the
first few patches of David's series and polish them to add proper pci_
and vio_ accessors for use by devices while we iron out what we want to
do with the infrastructure.

Cheers,
Ben.

  reply	other threads:[~2012-06-14  1:34 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 [this message]
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
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=1339637650.9220.134.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --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).