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.