X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fpci.c;h=f9c7d1aee87041d5d1f3f84f4175c72f277b9abc;hb=4454a172129d12e97793c9c353339b85d3335af4;hp=b5abc152d067b687de46d83eee5cebedb4dc95c3;hpb=acaadd79c597c8d5180fbfbec79c01fef3dff003;p=palacios.git diff --git a/palacios/src/devices/pci.c b/palacios/src/devices/pci.c index b5abc15..f9c7d1a 100644 --- a/palacios/src/devices/pci.c +++ b/palacios/src/devices/pci.c @@ -170,19 +170,19 @@ static void pci_dump_state(struct pci_internal * pci_state) { struct rb_node * node = v3_rb_first(&(pci_state->bus_list[0].devices)); struct pci_device * tmp_dev = NULL; - PrintDebug(core->vm_info, core, "===PCI: Dumping state Begin ==========\n"); + PrintDebug(VM_NONE, VCORE_NONE, "===PCI: Dumping state Begin ==========\n"); do { tmp_dev = rb_entry(node, struct pci_device, dev_tree_node); - PrintDebug(core->vm_info, core, "PCI Device Number: %d (%s):\n", tmp_dev->dev_num, tmp_dev->name); - PrintDebug(core->vm_info, core, "irq = %d\n", tmp_dev->config_header.intr_line); - PrintDebug(core->vm_info, core, "Vend ID: 0x%x\n", tmp_dev->config_header.vendor_id); - PrintDebug(core->vm_info, core, "Device ID: 0x%x\n", tmp_dev->config_header.device_id); + PrintDebug(VM_NONE, VCORE_NONE, "PCI Device Number: %d (%s):\n", tmp_dev->dev_num, tmp_dev->name); + PrintDebug(VM_NONE, VCORE_NONE, "irq = %d\n", tmp_dev->config_header.intr_line); + PrintDebug(VM_NONE, VCORE_NONE, "Vend ID: 0x%x\n", tmp_dev->config_header.vendor_id); + PrintDebug(VM_NONE, VCORE_NONE, "Device ID: 0x%x\n", tmp_dev->config_header.device_id); } while ((node = v3_rb_next(node))); - PrintDebug(core->vm_info, core, "====PCI: Dumping state End==========\n"); + PrintDebug(VM_NONE, VCORE_NONE, "====PCI: Dumping state End==========\n"); } #endif @@ -195,11 +195,11 @@ static int get_free_dev_num(struct pci_bus * bus) { int i, j; for (i = 0; i < sizeof(bus->dev_map); i++) { - PrintDebug(core->vm_info, core, "i=%d\n", i); + PrintDebug(VM_NONE, VCORE_NONE, "i=%d\n", i); if (bus->dev_map[i] != 0xff) { // availability for (j = 0; j < 8; j++) { - PrintDebug(core->vm_info, core, "\tj=%d\n", j); + PrintDebug(VM_NONE, VCORE_NONE, "\tj=%d\n", j); if (!(bus->dev_map[i] & (0x1 << j))) { return ((i * 8) + j); } @@ -856,6 +856,7 @@ static int bar_update(struct pci_device * pci_dev, uint32_t offset, // only do this if pci device is enabled.... if (!(pci_dev->config_header.status & 0x1)) { PrintError(VM_NONE, VCORE_NONE, "PCI Device IO space not enabled\n"); + break; } for (i = 0; i < bar->num_ports; i++) { @@ -1389,6 +1390,9 @@ static inline int init_bars(struct v3_vm_info * vm, struct pci_device * pci_dev) // Call the bar init function to get the local cached value bar->bar_init(i, &(bar->val), bar->private_data); + // Copy back changes it made + *(uint32_t *)(pci_dev->config_space + bar_offset) = bar->val; + } else { PrintError(vm, VCORE_NONE, "Invalid BAR type for bar #%d\n", i); return -1;