From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZINsz-0005mm-1S for qemu-devel@nongnu.org; Thu, 23 Jul 2015 17:18:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZINst-0006n2-Ek for qemu-devel@nongnu.org; Thu, 23 Jul 2015 17:18:36 -0400 Date: Fri, 24 Jul 2015 00:18:27 +0300 From: "Michael S. Tsirkin" Message-ID: <20150724001710-mutt-send-email-mst@redhat.com> References: <1437566099-10004-1-git-send-email-lvivier@redhat.com> <1437675858-14070-1-git-send-email-lvivier@redhat.com> <20150723212731-mutt-send-email-mst@redhat.com> <1437684537.7562.63.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437684537.7562.63.camel@kernel.crashing.org> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2] pci: allow 0 address for PCI IO/MEM regions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Laurent Vivier , David Gibson , qemu-ppc@nongnu.org, Michael Roth , qemu-devel@nongnu.org On Fri, Jul 24, 2015 at 06:48:57AM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2015-07-23 at 21:30 +0300, Michael S. Tsirkin wrote: > > > @@ -1075,7 +1080,8 @@ static pcibus_t pci_bar_address(PCIDevice *d, > > > /* Check if 32 bit BAR wraps around explicitly. > > > * TODO: make priorities correct and remove this work > > around. > > > */ > > > - if (last_addr <= new_addr || new_addr == 0 || last_addr >= > > UINT32_MAX) { > > > + if (last_addr <= new_addr || last_addr >= UINT32_MAX || > > > + (!allow_0_address && new_addr == 0)) { > > > return PCI_BAR_UNMAPPED; > > > } > > Talking of which, how can a BAR wrap around ? BARs are always power-of > two aligned and naturally aligned (to their own size), they can't > wrap... > > Ben. > True. I seem to have thought it important: https://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg02594.html but it makes no sense to me now. -- MST