From: Avi Kivity <avi@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Newbie: How to implement iommu?
Date: Mon, 06 Apr 2009 20:41:16 +0300 [thread overview]
Message-ID: <49DA3EBC.5050009@redhat.com> (raw)
In-Reply-To: <1239033090.1975.78.camel@nibbler.dlib.indiana.edu>
Brian Wheeler wrote:
> I've been going through the source (and the list archives) and I must be
> missing something obvious.
>
Many things in qemu are not obvious and are easy to miss, so you may
drop this disclaimer in the future, if you like.
> I need to translate an address passed to
> cpu_physical_memory_{read,write} via an IOMMU. I've been told there's a
> dma api, but I cannot find any documentation about it, nor can I find an
> obvious user of it.
>
The core dma api is cpu_physical_memory_{map,unmap}(), in exec.c. One
user is hw/ide.c, through the helpers in dma-helpers.c.
> So how do I catch cpu_physical_memory_{read,write} calls and put my
> address translation in there?
>
I guess these should be replaced by a pci_memory_{read,write}() (or
equivalents for other busses) which would do the translation. Given
that the translation changes depending on where you are in the system
topology, you'd need to pass an identifier representing that (for pci,
your PCIDevice pointer).
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
prev parent reply other threads:[~2009-04-06 17:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-06 15:51 [Qemu-devel] Newbie: How to implement iommu? Brian Wheeler
2009-04-06 17:41 ` Avi Kivity [this message]
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=49DA3EBC.5050009@redhat.com \
--to=avi@redhat.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).