From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5Ihh-0004As-EH for qemu-devel@nongnu.org; Tue, 03 Nov 2009 07:41:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5Ihc-000478-Ih for qemu-devel@nongnu.org; Tue, 03 Nov 2009 07:41:40 -0500 Received: from [199.232.76.173] (port=49505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5Ihc-00046z-B0 for qemu-devel@nongnu.org; Tue, 03 Nov 2009 07:41:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54538) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5Ihb-0006we-SH for qemu-devel@nongnu.org; Tue, 03 Nov 2009 07:41:36 -0500 Date: Tue, 3 Nov 2009 14:39:06 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH V6 17/32] pci: 64bit bar support. Message-ID: <20091103123906.GB4961@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> <20091103114756.GC3375@redhat.com> <4AF0206F.7080004@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF0206F.7080004@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Isaku Yamahata , qemu-devel@nongnu.org On Tue, Nov 03, 2009 at 02:22:07PM +0200, Avi Kivity wrote: > On 11/03/2009 01:47 PM, Michael S. Tsirkin wrote: >> >> 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. >> >> > > What happens if you take a PCI card that supports 64-bit BARs and stick > it into a machine that has a 32-bit physical address space? > The firmware/OS will configure the BARs to below 4G. > >> 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? >> > > No. Device emulation shouldn't change with the machine type. I agree. Issue is, we recompile the *devices* as well. It's the device emulation that is broken when compiled with target phys addr set to 32 bit, because all devices take pcibus_t and cast it to target_phys_addr_t and then do stuff with it. So such emulation should not claim to support 64 bit. Long term, we should fix all devices and *then* they can claim 64 bit support always. As a nice side effect, we'll be able to avoid rebuilding devices. > -- > error compiling committee.c: too many arguments to function