Fix pci bus-master & ehci migration
cover Fix pci bus-master & ehci migration
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
PATCH 1/2 ehci-pci: Fix crash on migration / migration not working
Signed-off-by Hans de Goede <[email protected]>
--- hw/usb/hcd-ehci-pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/usb/hcd-ehci-pci.c +2 -1
@@ -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; }
Signature · 1 line
1.7.12.1
PATCH 2/2 pci: Restore bus-master memory mapping state after migration
This fixes dma reads / writes from pci-devices no longer working after migration.
Signed-off-by Hans de Goede <[email protected]>
--- hw/pci.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/pci.c +4 -0
@@ -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 ; }
Signature · 1 line
1.7.12.1