From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: "Màrius Montón" <marius.monton@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: PCI address question
Date: Tue, 27 Oct 2009 11:16:40 -0400 [thread overview]
Message-ID: <20091027151640.GH5526@csclub.uwaterloo.ca> (raw)
In-Reply-To: <4AE70C35.6050909@gmail.com>
On Tue, Oct 27, 2009 at 04:05:25PM +0100, Màrius Montón wrote:
> Màrius Montón wrote:
> > Hello,
> >
> > For my PCI device to QEMU, I need the real address the PCI bus is using
> > to access my device. For a IO BAR (PCI_ADDRESS_SPACE_IO), I receive the
> > real address (like 0xc200 or similar), but when registering a
> > PCI_ADDRESS_SPACE_MEM I only receive the offset to the BAR.
> >
> > How I can receive or obtaint the real address on each access to my device?
> >
> > Cjeers,
> >
> > Màrius
> >
> nobody can tell me anything? :(
Add the offset to the address in the bar?
After all the OS is allowed to change your BAR if it wants to.
So internally the only thing that makes sense to a PCI device is the
offset from it's base address.
You listen to addresses at your IO range, and at your memory BAR range.
What you do when you see a request for your range then depends on the
offset that address had from the current base. This would also be true
for the IO.
--
Len Sorensen
next prev parent reply other threads:[~2009-10-27 15:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 9:51 [Qemu-devel] PCI address question Màrius Montón
2009-10-27 15:05 ` [Qemu-devel] " Màrius Montón
2009-10-27 15:16 ` Lennart Sorensen [this message]
2009-10-29 11:30 ` Màrius Montón
2009-10-29 12:12 ` [Qemu-devel] " Michael S. Tsirkin
2009-10-29 13:05 ` [Qemu-devel] " Màrius Montón
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=20091027151640.GH5526@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=marius.monton@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).