Skip to contentSkip to conversation

Don't unregister unassigned PCI BAR

PATCH Applied Gleb Natapov 4 participants 4 messages Feb 3, 2009 – Feb 12, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't unregister unassigned PCI BAR

qemu/hw/pci.c +1 -1
index 04aecc2..a6d57e5 100644
@@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
 
     for(i = 0; i < PCI_NUM_REGIONS; i++) {
         r = &pci_dev->io_regions[i];
-        if (!r->size)
+        if (!r->size || r->addr == -1)
             continue;
         if (r->type == PCI_ADDRESS_SPACE_IO) {
             isa_unassign_ioport(r->addr, r->size);

--
Gleb.

Applied
#1 lore raw
Quoted 7 lines · Gleb Natapov
qemu/hw/pci.c +0 -0
index 04aecc2..a6d57e5 100644

qemu/hw/pci.c static void pci_unregister_io_regions(PCIDevice *pci_dev) · line 219

Quoted 8 lines
qemu/hw/pci.c +1 -1
@@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
 
     for(i = 0; i < PCI_NUM_REGIONS; i++) {
         r = &pci_dev->io_regions[i];
-        if (!r->size)
+        if (!r->size || r->addr == -1)
             continue;
         if (r->type == PCI_ADDRESS_SPACE_IO) {
             isa_unassign_ioport(r->addr, r->size);

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#2 lore raw
In reply to Gleb Natapov
Quoted 15 lines · Gleb Natapov
qemu/hw/pci.c +1 -2
index 04aecc2..a6d57e5 100644
@@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
 
     for(i = 0; i < PCI_NUM_REGIONS; i++) {
         r = &pci_dev->io_regions[i];
-        if (!r->size)
+        if (!r->size || r->addr == -1)
             continue;
         if (r->type == PCI_ADDRESS_SPACE_IO) {
             isa_unassign_ioport(r->addr, r->size);
--
Quoted 1 line

Gleb.

ACK, please apply.

#3 lore raw
In reply to Gleb Natapov

qemu/hw/pci.c static void pci_unregister_io_regions(PCIDevice *pci_dev) · line 217

Quoted 9 lines · * Gleb Natapov ([email protected]) wrote:
qemu/hw/pci.c +1 -1
@@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
 
     for(i = 0; i < PCI_NUM_REGIONS; i++) {
         r = &pci_dev->io_regions[i];
-        if (!r->size)
+        if (!r->size || r->addr == -1)
             continue;

Without this patch the error path for device assignment will segfault (trying to unregister addr -1). Please consider for maint/2.6.29.

thanks,
-chris