From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZINQZ-0002Uc-OV for qemu-devel@nongnu.org; Thu, 23 Jul 2015 16:49:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZINQY-00025U-P2 for qemu-devel@nongnu.org; Thu, 23 Jul 2015 16:49:15 -0400 Message-ID: <1437684537.7562.63.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Fri, 24 Jul 2015 06:48:57 +1000 In-Reply-To: <20150723212731-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> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: Laurent Vivier , David Gibson , qemu-ppc@nongnu.org, Michael Roth , qemu-devel@nongnu.org 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.