Hi, > > new_addr = pci_bar_address(d, i, r->type, r->size); > > + if (!d->has_power) { > > + new_addr = PCI_BAR_UNMAPPED; > > + } > > > > /* This bar isn't changed */ > > if (new_addr == r->addr) > > I am a bit confused about why this is necessary. > When power is removed device is reset, does not > this disable device memory automatically?
Hmm. While it clearly doesn't hurt it might not be needed indeed. The reset-on-poweroff should make sure both bars and dma are off, and due to config space access being blocked the guest shouldn't be able to turn them on while device power is off. So, yes, in theory we should be able to drop this. Assuming nothing in qemu ever touches the bar mappings (host access to config space is not blocked). I'll have a look. take care, Gerd