From: David Gibson <dwg@au1.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
joerg.roedel@amd.com, agraf@suse.de, qemu-devel@nongnu.org,
eduard.munteanu@linux360.ro, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA
Date: Fri, 2 Sep 2011 14:40:28 +1000 [thread overview]
Message-ID: <20110902044028.GY11906@yookeroo.fritz.box> (raw)
In-Reply-To: <4E5FACD6.9000603@redhat.com>
On Thu, Sep 01, 2011 at 07:03:34PM +0300, Avi Kivity wrote:
> On 09/01/2011 06:55 PM, Anthony Liguori wrote:
> >On 09/01/2011 12:00 AM, David Gibson wrote:
> >>This patch adds functions to pci.[ch] to perform PCI DMA operations. At
> >>present, these are just stubs which perform directly cpu physical memory
> >>accesses.
> >>
> >>Using these stubs, however, distinguishes PCI device DMA
> >>transactions from
> >>other accesses to physical memory, which will allow PCI IOMMU support to
> >>be added in one place, rather than updating every PCI driver at
> >>that time.
> >>
> >>That is, it allows us to update individual PCI drivers to
> >>support an IOMMU
> >>without having yet determined the details of how the IOMMU
> >>emulation will
> >>operate. This will let us remove the most bitrot-sensitive part of an
> >>IOMMU patch in advance.
> >>
> >>Signed-off-by: David Gibson<david@gibson.dropbear.id.au>
> >
> >I think this is the wrong approach given the introduction of the
> >memory API.
> >
> >I think we should have a generic memory access function that takes
> >a MemoryRegion as it's first argument.
> >
> >The PCI bus should then expose one memory region for each device
> >(that's how it can figure out where the access is coming from).
> >
> >Richard/Avi, what do you think?
>
> I think the patchset is fine. It routes all access through
> pci_dma_rw(), which accepts a PCIDevice. We can later define
> pci_dma_rw() in terms of the memory API and get the benefit of the
> memory hierarchy.
Right. Exactly what to use as a handle on the right bus / DMA
addressing context is something still to be thrashed out - a
MemoryRegion may well be the right answer.
But whatever we do there, a convenience wrapper would be useful for
the common case of PCI devices - certainly the correct addressing
context should be reachable from the PCI device.
This approach means we can get most of the PCI drivers IOMMU ready
now, and we just need fix the final IOMMU support in one place,
instead of in every PCI driver.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next prev parent reply other threads:[~2011-09-02 5:08 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 5:00 [Qemu-devel] [0/10] Preliminary work for IOMMU emulation support; the easy bits David Gibson
2011-09-01 5:00 ` [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA David Gibson
2011-09-01 15:35 ` Michael S. Tsirkin
2011-09-02 0:39 ` David Gibson
2011-09-02 4:38 ` David Gibson
2011-09-05 7:55 ` Michael S. Tsirkin
2011-09-01 15:55 ` Anthony Liguori
2011-09-01 16:03 ` Avi Kivity
2011-09-01 16:05 ` Anthony Liguori
2011-09-01 16:11 ` Avi Kivity
2011-09-01 16:32 ` Anthony Liguori
2011-09-02 8:35 ` Avi Kivity
2011-09-03 12:25 ` Blue Swirl
2011-09-02 0:38 ` David Gibson
2011-09-02 8:37 ` Avi Kivity
2011-09-03 3:04 ` Eduard - Gabriel Munteanu
2011-09-02 4:40 ` David Gibson [this message]
2011-09-03 1:16 ` Richard Henderson
2011-09-23 16:37 ` Anthony Liguori
2011-09-01 5:00 ` [Qemu-devel] [PATCH 02/10] rtl8139: Use PCI DMA stub functions David Gibson
2011-09-01 5:00 ` [Qemu-devel] [PATCH 03/10] eepro100: " David Gibson
2011-09-01 5:00 ` [Qemu-devel] [PATCH 04/10] ac97: " David Gibson
2011-09-01 5:00 ` [Qemu-devel] [PATCH 05/10] es1370: " David Gibson
2011-09-01 5:00 ` [Qemu-devel] [PATCH 06/10] e1000: " David Gibson
2011-09-01 5:01 ` [Qemu-devel] [PATCH 07/10] lsi53c895a: " David Gibson
2011-09-01 5:01 ` [Qemu-devel] [PATCH 08/10] pcnet-pci: " David Gibson
2011-09-01 5:01 ` [Qemu-devel] [PATCH 09/10] usb-ohci: " David Gibson
2011-09-01 10:10 ` Gerd Hoffmann
2011-09-02 1:47 ` David Gibson
2011-09-01 5:01 ` [Qemu-devel] [PATCH 10/10] intel-hda: " David Gibson
2011-09-01 10:16 ` Gerd Hoffmann
2011-09-02 1:42 ` David Gibson
2011-09-01 11:33 ` [Qemu-devel] [0/10] Preliminary work for IOMMU emulation support; the easy bits Eduard - Gabriel Munteanu
2011-09-02 0:36 ` David Gibson
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=20110902044028.GY11906@yookeroo.fritz.box \
--to=dwg@au1.ibm.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=eduard.munteanu@linux360.ro \
--cc=joerg.roedel@amd.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).