From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgIgc-0003d4-Mm for qemu-devel@nongnu.org; Thu, 29 Dec 2011 11:18:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgIgb-0007Ny-AP for qemu-devel@nongnu.org; Thu, 29 Dec 2011 11:18:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgIgb-0007LE-2D for qemu-devel@nongnu.org; Thu, 29 Dec 2011 11:18:33 -0500 Date: Thu, 29 Dec 2011 18:16:59 +0200 From: "Michael S. Tsirkin" Message-ID: <20111229161650.GC2300@redhat.com> References: <4EFA9DF0.7050902@endace.com> <4EFAA86D.3090103@endace.com> <20111229025647.GB29199@morn.localdomain> <4EFBFB75.1060609@endace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EFBFB75.1060609@endace.com> Subject: Re: [Qemu-devel] [PATCH 2/3] Add a new PCI region type to supports 64 bit ranges List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Korolev Cc: sfd@endace.com, yamahata@valinux.co.jp, Kevin O'Connor , seabios@seabios.org, qemu-devel@nongnu.org On Thu, Dec 29, 2011 at 06:32:37PM +1300, Alexey Korolev wrote: > > >>@@ -69,6 +72,8 @@ static enum pci_region_type pci_addr_to_type(u32 addr) > >> { > >> if (addr& PCI_BASE_ADDRESS_SPACE_IO) > >> return PCI_REGION_TYPE_IO; > >>+ if (addr& PCI_BASE_ADDRESS_MEM_TYPE_64) > >>+ return PCI_REGION_TYPE_PREFMEM_64; > >This seems dangerous - a 64bit bar can be non-prefetchable - getting > >this wrong could cause random (hard to debug) crashes. > > > Just out of curiosity - how this could happen? Having 64bit > non-prefetchable BAR implies that the device is not behind > any bridge (as bridges describe 64bit ranges for prefetchable > memory only). Is it possible on nowadays systems? Yes. qemu puts all devices directly on the root bus. system devices are also commonly located on the root bus.