From: Paul Brook <paul@codesourcery.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: PATCH, RFC: Generic DMA framework
Date: Sat, 8 Sep 2007 17:03:07 +0100 [thread overview]
Message-ID: <200709081703.08899.paul@codesourcery.com> (raw)
In-Reply-To: <f43fc5580709080753q1bf1c97m754c7a8a555a263d@mail.gmail.com>
> > IIUC devices never register addresses on the master bus. The only thing
> > that responds on that bus is the IOMMU.
>
> Generally yes, but these "intelligent masters" and their targets would
> register on on both buses. The only case I can only think of is a
> video grabber, it's frame memory could be accessed directly by other
> IO devices.
Ah, I think we've got different interpretations of what "registering" a device
involves. To a first approximation a master doesn't need to register with a
bus at all. Slave devices can't/don't need to identify which master initiated
the transaction. Plus all bus transactions are atomic w.r.t. other bus
traffic, so no arbitration is needed.
Masters will need to register with a bus insofar as they need to get a
reference to identify which bus they're talking to. They don't generally
reserve any bus address space though. Most devices are actually dual function
master/slave devices, so already have a bus handle from registering the slave
device.
> > > For the Sparc64 PCI bus which has an IOMMU, a similar dual bus
> > > arrangement would be needed. On PC/PPC systems the two buses would be
> > > again one.
> >
> > PCI shouldn't need a dual bus setup. You just have one bus for PCI and
> > one bus for CPU/memory.
>
> Then how would Sparc64 IOMMU intercept the device DMA? I'd think that
> PCI bus mastering works similarly as in SBus, or doesn't it?
A PCI host controller effectively consists of two bridges.
The CPU->PCI bridge responds to requests on the CPU bus, using simple linear
address translation to create PCI requests. The PCI->CPU bridge responds to
requests on the PCI bus (ie. device DMA), using an IOMMU to translate these
into CPU requests.
The interesting bits of a generic bus infrastructure are the bridges between
the busses, not the busses themselves.
Conceptually each access starts on the bus local to that device (the system
bus for the CPU, PCI bus for device DMA, etc), then recursively walks bus-bus
bridges until it finds a device. Walking over a bridge is what causes address
translation, and that translation is sensitive to direction.
I admit I haven't figured out how to implement this efficiently.
Paul
next prev parent reply other threads:[~2007-09-08 16:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 19:48 [Qemu-devel] PATCH, RFC: Generic DMA framework Blue Swirl
2007-08-16 18:18 ` [Qemu-devel] " Blue Swirl
2007-08-16 19:58 ` malc
2007-08-19 17:46 ` Blue Swirl
2007-08-24 19:40 ` Blue Swirl
2007-08-24 20:18 ` Paul Brook
2007-08-24 23:33 ` Fabrice Bellard
2007-08-25 0:29 ` Paul Brook
2007-08-26 11:30 ` Fabrice Bellard
2007-08-26 17:54 ` Blue Swirl
2007-08-28 19:03 ` Blue Swirl
2007-08-28 19:43 ` Paul Brook
2007-08-29 17:00 ` Blue Swirl
2007-08-29 20:39 ` Paul Brook
2007-08-29 21:18 ` Paul Brook
2007-09-08 14:07 ` Blue Swirl
2007-09-08 14:31 ` Paul Brook
2007-09-08 14:53 ` Blue Swirl
2007-09-08 16:03 ` Paul Brook [this message]
2007-09-15 16:16 ` Blue Swirl
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=200709081703.08899.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=blauwirbel@gmail.com \
--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).