From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5HuC-0004op-0o for qemu-devel@nongnu.org; Tue, 03 Nov 2009 06:50:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5Hu7-0004lT-4w for qemu-devel@nongnu.org; Tue, 03 Nov 2009 06:50:31 -0500 Received: from [199.232.76.173] (port=48233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5Hu6-0004lC-Vz for qemu-devel@nongnu.org; Tue, 03 Nov 2009 06:50:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43808) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5Hu6-0007yJ-Gq for qemu-devel@nongnu.org; Tue, 03 Nov 2009 06:50:26 -0500 Date: Tue, 3 Nov 2009 13:47:56 +0200 From: "Michael S. Tsirkin" Message-ID: <20091103114756.GC3375@redhat.com> References: <1256905286-25435-1-git-send-email-yamahata@valinux.co.jp> <1256905286-25435-18-git-send-email-yamahata@valinux.co.jp> <20091101160730.GA21894@redhat.com> <20091103035210.GA28390%yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091103035210.GA28390%yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH V6 17/32] pci: 64bit bar support. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Tue, Nov 03, 2009 at 12:52:10PM +0900, Isaku Yamahata wrote: > On Sun, Nov 01, 2009 at 06:07:30PM +0200, Michael S. Tsirkin wrote: > > On Fri, Oct 30, 2009 at 09:21:11PM +0900, Isaku Yamahata wrote: > > > implemented pci 64bit bar support. > > > The tricky bit is pci_update_mapping(). > > > An OS is allowed to set the BAR such that OS can't address the area > > > pointed by BAR. It doesn't make sense, though. > > > > It might make sense. 32 bit guest can address more than 4G of > > physical RAM, e.g. using PAE. > > Yes, in that case, guest OS will set bar to be under 36 bit. > If PAE were supported, target phys address would be 64 bit. > > > > Since I think qemu can not support this if target phys address is 32 > > bit, we should declare lack of support for 64 bit addressing on these > > platforms, by forcing BAR into 32 bit mode, rather than silently failing > > to map it. > > I don't get your point. And I don't understand the benefit of focing > BAR into 32 bit mode. > Real hardware silently maps BAR to address beyond CPU addressable > area. > Let's stick to PCI spec as you said before. > > 32 bit guest OS will set 64 bit BAR to be smaller 32bit > (or 36bit if PAE). That's it. > Even if 64 bit CPU case, architectally addressable address bit is smaller > than 64 bit. It's CPU implementation dependent. > And guest OS sets BAR according to it. > -- > yamahata IMO, this is not a question of what guest does or does not do. If qemu is compiled with target phys address size 32 bit, emulated devices can not support a 64 bit BAR. Therefore, according to PCI spec, such devices should declare all BARs as 32 bit. I think you are right that guests on such systems really do not have a way to address PCI devices if BAR is set beyond 4G. But pci emulation is better off not relying on this, IMO. Makes sense? -- MST