On Fri, Jul 23, 2010 at 10:40 AM, Isaku Yamahata <yamah...@valinux.co.jp> wrote: > On Thu, Jul 22, 2010 at 09:54:46PM +0000, Blue Swirl wrote: >> diff --git a/hw/pci.c b/hw/pci.c >> index a98d6f3..49f03fb 100644 >> --- a/hw/pci.c >> +++ b/hw/pci.c > ... >> @@ -817,6 +825,25 @@ void pci_register_bar(PCIDevice *pci_dev, int >> region_num, >> pci_set_long(pci_dev->wmask + addr, wmask & 0xffffffff); >> pci_set_long(pci_dev->cmask + addr, 0xffffffff); >> } >> + pci_bar_map(pci_dev, region_num, 0, 0, size, -1); >> +} >> + >> +void pci_bar_map(PCIDevice *pci_dev, int region_num, int subregion_num, >> + pcibus_t offset, pcibus_t size, int ix) >> +{ >> + PCIIOSubRegion *s; >> + >> + if ((unsigned int)region_num >= PCI_NUM_REGIONS || >> + (unsigned int)subregion_num >= PCI_NUM_SUBREGIONS) { >> + return; >> + } > > abort() or assert()? It's caller's bug.
Yes. I copied this from pci_register_bar(), which should also have assert() or abort().