WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] ioemu: Save PCI device INTx line states.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: Save PCI device INTx line states.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Apr 2008 06:30:13 -0700
Delivery-date: Fri, 25 Apr 2008 06:30:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1209028483 -3600
# Node ID 4e6577dec72973e49b2abf7dc0b1cdbe4f91bf45
# Parent  ae2b5cf5a68647394e503957ff28e1a334efdab9
ioemu: Save PCI device INTx line states.

Otherwise, ioemu can be out of sync with the hypervisor after
restoring guest state, if INTx lines were asserted when the state was
saved. This prevents ioemu from setting the line to zero in Xen
(because it thinks the line is already zero). This can allow th eguest
to enter an endless IRQ loop and hang.

Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/ioemu/hw/pci.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff -r ae2b5cf5a686 -r 4e6577dec729 tools/ioemu/hw/pci.c
--- a/tools/ioemu/hw/pci.c      Thu Apr 24 10:01:27 2008 +0100
+++ b/tools/ioemu/hw/pci.c      Thu Apr 24 10:14:43 2008 +0100
@@ -79,18 +79,30 @@ int pci_bus_num(PCIBus *s)
 
 void pci_device_save(PCIDevice *s, QEMUFile *f)
 {
-    qemu_put_be32(f, 1); /* PCI device version */
+    uint8_t irq_state = 0;
+    int i;
+    qemu_put_be32(f, 2); /* PCI device version */
     qemu_put_buffer(f, s->config, 256);
+    for (i = 0; i < 4; i++)
+        irq_state |= !!s->irq_state[i] << i;
+    qemu_put_buffer(f, &irq_state, 1);
 }
 
 int pci_device_load(PCIDevice *s, QEMUFile *f)
 {
     uint32_t version_id;
     version_id = qemu_get_be32(f);
-    if (version_id != 1)
+    if (version_id != 1 && version_id != 2)
         return -EINVAL;
     qemu_get_buffer(f, s->config, 256);
     pci_update_mappings(s);
+    if (version_id == 2) {
+        uint8_t irq_state;
+        int i;
+        qemu_get_buffer(f, &irq_state, 1);
+        for (i = 0; i < 4; i++)
+            pci_set_irq(s, i, !!(irq_state >> i));
+    }
     return 0;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: Save PCI device INTx line states., Xen patchbot-unstable <=