From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWFuB-0005ey-PX for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:33:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWFuB-0005ej-9m for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:33:11 -0400 Received: from [199.232.76.173] (port=34618 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWFuB-0005eg-51 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:33:11 -0400 Received: from savannah.gnu.org ([199.232.41.3]:57265 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWFuB-0006oc-7s for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:33:11 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KWFuA-0005Ta-5M for qemu-devel@nongnu.org; Thu, 21 Aug 2008 19:33:10 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KWFu9-0005TW-UU for qemu-devel@nongnu.org; Thu, 21 Aug 2008 19:33:10 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 21 Aug 2008 19:33:09 +0000 Subject: [Qemu-devel] [5054] uhci: fixes for save/load-vm (Max Krasnyansky) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5054 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5054 Author: aliguori Date: 2008-08-21 19:33:09 +0000 (Thu, 21 Aug 2008) Log Message: ----------- uhci: fixes for save/load-vm (Max Krasnyansky) For some reason we were not registering save/load-vm handler for piix3 flavor of UHCI and hence save/load was broken. Async transactions need to be canceled when we save the VM because there is no way we can save/restore all that state. Since we do not mess the original TD/QH the driver will simply resubmit the transfers. Tested with Windows XP-SP2 running under QEMU/KQEMU. Signed-off-by: Max Krasnyansky Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/usb-uhci.c Modified: trunk/hw/usb-uhci.c =================================================================== --- trunk/hw/usb-uhci.c 2008-08-21 19:32:29 UTC (rev 5053) +++ trunk/hw/usb-uhci.c 2008-08-21 19:33:09 UTC (rev 5054) @@ -310,6 +310,8 @@ int i; UHCIPort *port; + dprintf("uhci: full reset\n"); + pci_conf = s->dev.config; pci_conf[0x6a] = 0x01; /* usb clock */ @@ -331,13 +333,14 @@ uhci_async_cancel_all(s); } -#if 1 static void uhci_save(QEMUFile *f, void *opaque) { UHCIState *s = opaque; uint8_t num_ports = NB_PORTS; int i; + uhci_async_cancel_all(s); + pci_device_save(&s->dev, f); qemu_put_8s(f, &num_ports); @@ -383,7 +386,6 @@ return 0; } -#endif static void uhci_ioport_writeb(void *opaque, uint32_t addr, uint32_t val) { @@ -1009,6 +1011,8 @@ qemu_del_timer(s->frame_timer); /* set hchalted bit in status - UHCI11D 2.1.2 */ s->status |= UHCI_STS_HCHALTED; + + dprintf("uhci: halted\n"); return; } @@ -1082,6 +1086,8 @@ to rely on this. */ pci_register_io_region(&s->dev, 4, 0x20, PCI_ADDRESS_SPACE_IO, uhci_map); + + register_savevm("uhci", 0, 1, uhci_save, uhci_load, s); } void usb_uhci_piix4_init(PCIBus *bus, int devfn)