qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Fix pci bus-master & ehci migration
@ 2012-11-08 11:29 Hans de Goede
  2012-11-08 11:54 ` [Qemu-devel] [PATCH 1/2] ehci-pci: Fix crash on migration / migration not working Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2012-11-08 11:29 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

Not sure if this should go in through your USB tree, as this also touched PCI
in general, but my ehci migration troubles were the reason I wrote this...

Regards,

Hans

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] ehci-pci: Fix crash on migration / migration not working
  2012-11-08 11:29 [Qemu-devel] [PATCH 0/2] Fix pci bus-master & ehci migration Hans de Goede
@ 2012-11-08 11:54 ` Hans de Goede
  2012-11-08 11:54   ` [Qemu-devel] [PATCH 2/2] pci: Restore bus-master memory mapping state after migration Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2012-11-08 11:54 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/hcd-ehci-pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index d5c7d46..fe45a1f 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -91,6 +91,7 @@ static const VMStateDescription vmstate_ehci_pci = {
     .fields      = (VMStateField[]) {
         VMSTATE_PCI_DEVICE(pcidev, EHCIPCIState),
         VMSTATE_STRUCT(ehci, EHCIPCIState, 2, vmstate_ehci, EHCIState),
+        VMSTATE_END_OF_LIST()
     }
 };
 
@@ -105,7 +106,7 @@ static void ehci_class_init(ObjectClass *klass, void *data)
     k->device_id = i->device_id;
     k->revision = i->revision;
     k->class_id = PCI_CLASS_SERIAL_USB;
-    dc->vmsd = &vmstate_ehci;
+    dc->vmsd = &vmstate_ehci_pci;
     dc->props = ehci_pci_properties;
 }
 
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] pci: Restore bus-master memory mapping state after migration
  2012-11-08 11:54 ` [Qemu-devel] [PATCH 1/2] ehci-pci: Fix crash on migration / migration not working Hans de Goede
@ 2012-11-08 11:54   ` Hans de Goede
  0 siblings, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2012-11-08 11:54 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel

This fixes dma reads / writes from pci-devices no longer working after
migration.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/pci.c b/hw/pci.c
index dceda0b..6666651 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -367,6 +367,10 @@ static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
 
     pci_update_mappings(s);
 
+    memory_region_set_enabled(&s->bus_master_enable_region,
+                              pci_get_word(s->config + PCI_COMMAND)
+                                & PCI_COMMAND_MASTER);
+
     g_free(config);
     return 0;
 }
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-08 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 11:29 [Qemu-devel] [PATCH 0/2] Fix pci bus-master & ehci migration Hans de Goede
2012-11-08 11:54 ` [Qemu-devel] [PATCH 1/2] ehci-pci: Fix crash on migration / migration not working Hans de Goede
2012-11-08 11:54   ` [Qemu-devel] [PATCH 2/2] pci: Restore bus-master memory mapping state after migration Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).