Skip to contentSkip to conversation

Sparc64 breakage by 16eaedf2668e9b347a59d73346fcc4c764c58348

Qemu-devel Blue Swirl 3 participants 4 messages Jul 10, 2009

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Hi,

APB is not converted to qdev yet, so pci_register_secondary_bus shouldn't use FROM_QBUS. Sparc64 is currently broken.

Partially reverting 16eaed... fixes the breakage:

hw/pci.c +0 -0
index 71d9227..f592925 100644
@@ -135,7 +135,7 @@ static PCIBus

*pci_register_secondary_bus(PCIDevice *dev, pci_map_irq_fn map_irq

 {
     PCIBus *bus;

- bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev, NULL));

+    bus = qemu_mallocz(sizeof(PCIBus));
     bus->map_irq = map_irq;
     bus->parent_dev = dev;
     bus->next = dev->bus->next;
#1 lore raw
Quoted 19 lines · Blue Swirl

Hi,

APB is not converted to qdev yet, so pci_register_secondary_bus shouldn't use FROM_QBUS. Sparc64 is currently broken.

Partially reverting 16eaed... fixes the breakage:

hw/pci.c +1 -1
index 71d9227..f592925 100644
@@ -135,7 +135,7 @@ static PCIBus
 *pci_register_secondary_bus(PCIDevice *dev, pci_map_irq_fn map_irq
 {
     PCIBus *bus;
 
-    bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev, NULL));
+    bus = qemu_mallocz(sizeof(PCIBus));
     bus->map_irq = map_irq;
     bus->parent_dev = dev;
Quoted 2 lines
     bus->next = dev->bus->next;

Gerd, could you take a look?

Blue, you mentioned that you have an openbios-sparc64 image for testing? Would that have uncovered this and if so, do you have a link handy?

Regards,

Anthony Liguori

author
#2 lore raw
Quoted 27 lines · Anthony Liguori

hw/pci.c static PCIBus · line 135

Quoted 12 lines · Blue Swirl

Hi,

APB is not converted to qdev yet, so pci_register_secondary_bus shouldn't use FROM_QBUS. Sparc64 is currently broken.

Partially reverting 16eaed... fixes the breakage:

hw/pci.c +0 -0
index 71d9227..f592925 100644
@@ -135,7 +135,7 @@ static PCIBus
 *pci_register_secondary_bus(PCIDevice *dev,

pci_map_irq_fn map_irq

hw/pci.c static PCIBus · line 139

Quoted 4 lines
hw/pci.c +0 -1
 {
    PCIBus *bus;
 
-    bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev,

NULL));

Quoted 6 lines
hw/pci.c +1 -0
+    bus = qemu_mallocz(sizeof(PCIBus));
    bus->map_irq = map_irq;
    bus->parent_dev = dev;
    bus->next = dev->bus->next;
Quoted 4 lines

Gerd, could you take a look?

Blue, you mentioned that you have an openbios-sparc64 image for testing?
Would that have uncovered this and if so, do you have a link handy?

We deliver the latest (r505) OpenBIOS image at pc-bios/openbios-sparc64.

To test this bug, the following is enough:
./obj-amd64/sparc64-softmmu/qemu-system-sparc64 -L ./pc-bios/ Segmentation fault

With my patch applied, you get the OpenBIOS Forth prompt.

#3 lore raw
In reply to Anthony Liguori
Quoted 6 lines · Anthony Liguori
Quoted 4 lines · Blue Swirl

Hi,

APB is not converted to qdev yet, so pci_register_secondary_bus shouldn't use FROM_QBUS. Sparc64 is currently broken.

Quoted 7 lines

hw/pci.c

Quoted 5 lines

Partially reverting 16eaed... fixes the breakage:

hw/pci.c +1 -1
- bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev, NULL));
+ bus = qemu_mallocz(sizeof(PCIBus));

Gerd, could you take a look?

As sparc64 is the only user of pci_register_secondary_bus() the partial reverse is fine IMHO. Just let us defer this until APB is qdev-ified.

cheers,
Gerd