qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] usb: usb tablet freeze when save/restore guest os


From: Gonglei (Arei)
Subject: [Qemu-devel] usb: usb tablet freeze when save/restore guest os
Date: Tue, 13 May 2014 09:04:32 +0000

Hi,

For recent Linux guests, the usb tablet will be suspended when it is idle.
When Qemu detect the usb tablet event, will call uhci_wakeup(), which
according the value of port->ctrl to decide to call uhci_resume() or not. 
UHCI_PORT_RD bit is set to 1 for UHCI is resuming, and qemu will not call
uhci_resume(). The other way round, qemu will call uhci_resume() and then
post a interrupt to guest os, meanwhile set UHCI_PORT_RD bit to 1.

In the guests, after handle the interrupt, will call uhci_finish_suspend(), 
which
clear UHCI_PORT_RD bit, Then qemu will know that the UHCI resume
process has finished.

In the situation of save/restore guest os, when the guest os is saving 
memory iteratively, meanwhile the usb tablet work normally (by vnc). When qemu
has set the UHCI_PORT_RD bit to 1, and post a interrupt to guest os, but
guest os has hibernated this moment, so the interrupt cannot be handled
in time. So, the UHCI_PORT_RD bit will not be cleared by uhci_finish_suspend().

When we restore the guest os, and the usb tablet event happen again, but 
because of UHCI_PORT_RD bit being set to 1, qemu consider the guest os is
handling the interrupt of resuming UHCI, so will not post another interrupt.
For guest os, will not handle UHCI event because it not receive an interrupt,
which cause usb tablet freeze.  

So, we should provide a mechanism for avoiding losing interrupt of UHCI.
IMHO the LEGACY SUPPORT REGISTER will give us some help, and I have
finished a patch and tested it work well.

Anything idea? Thanks!


Best regards,
-Gonglei





reply via email to

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