From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2nmw-0007Iu-GS for qemu-devel@nongnu.org; Tue, 27 Oct 2009 11:16:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2nms-0007IS-Az for qemu-devel@nongnu.org; Tue, 27 Oct 2009 11:16:46 -0400 Received: from [199.232.76.173] (port=38155 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2nms-0007IO-5T for qemu-devel@nongnu.org; Tue, 27 Oct 2009 11:16:42 -0400 Received: from caffeine.csclub.uwaterloo.ca ([129.97.134.17]:47747) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2nmr-0005vv-UQ for qemu-devel@nongnu.org; Tue, 27 Oct 2009 11:16:42 -0400 Date: Tue, 27 Oct 2009 11:16:40 -0400 Subject: Re: [Qemu-devel] Re: PCI address question Message-ID: <20091027151640.GH5526@csclub.uwaterloo.ca> References: <4ADED9A0.3000605@gmail.com> <4AE70C35.6050909@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4AE70C35.6050909@gmail.com> From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?TcOgcml1cyBNb250w7Nu?= Cc: qemu-devel@nongnu.org On Tue, Oct 27, 2009 at 04:05:25PM +0100, M=C3=A0rius Mont=C3=B3n wrote: > M=C3=A0rius Mont=C3=B3n wrote: > > Hello, > > > > For my PCI device to QEMU, I need the real address the PCI bus is usi= ng > > to access my device. For a IO BAR (PCI_ADDRESS_SPACE_IO), I receive t= he > > 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 de= vice? > > > > Cjeers, > > > > M=C3=A0rius > > =20 > 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. --=20 Len Sorensen