qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] get_pci_irq_state causes inconsistent pci_irq_state


From: Xusheng Chen
Subject: [Qemu-stable] get_pci_irq_state causes inconsistent pci_irq_state
Date: Fri, 21 Apr 2017 01:16:15 +0800

Dear qemu developers, 

I am interested in qemu and found one bug that crash colo-fault-tolerance because of inconsistent PCI state. 

It is confirmed by the colo developers and they said it is likely to be a generic bug that will also break migration. 

When the receiver of a device state calls get_pci_irq_state(hw/pci/pci.c L506), it only set the irq_state of the device but not that of the PCI bus. As a result, when the sync is doing very frequently, there may be inconsistencies between the irq_state of the PCI bus and the devices, causing the assertion(L311) failed and the whole system halted.

One possible patch is as follows:
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -520,6 +520,10 @@ static int get_pci_irq_state(QEMUFile *f, void *pv, size_t size,
 
     for (i = 0; i < PCI_NUM_PINS; ++i) {
         pci_set_irq_state(s, i, irq_state[i]);
+        if (irq_state[i] != 0){
+            s->bus->set_irq(s->bus->irq_opaque, PCI_NUM_PINS-1-i , 1);
+            s->bus->irq_count[PCI_NUM_PINS-1-i] = 1; 
+        }
     }


Thanks and regards,
Xusheng Chen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]