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

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



> -----Original Message-----
> From: Gerd Hoffmann [mailto:kraxel@xxxxxxxxxx]
> Sent: Thursday, May 15, 2014 2:50 PM
> To: Gonglei (Arei)
> Cc: Paolo Bonzini; qemu-devel@xxxxxxxxxx; Huangweidong (C); Michael S.
> Tsirkin
> Subject: Re: usb: usb tablet freeze when save/restore guest os
> 
>   Hi,
> 
> > Well then, may I post a formal patch for this issue, Gerd? Thanks.
> 
> I'd like to know what the root cause for the lost interrupt is.
> 
Hi, Gerd. I must clarify the scene of this issue.

1)The problem occurred on Xen platform. 
the process of hibernate vm on Xen:
 suspend vm (pause all vcpus)
        call xc_save to save memory
                stop qemu (vm_stop)
                        save qemu 
                                destroy vm

2)The process of hibernate vm on KVM:
 vm_stop
        do_vm_stop
                pause_all_vcpus
                runstate_set(state); //change the runstate to paused

3)the usb tablet backtrace:
vnc_client_read
        protocol_client_msg
                pointer_event
                        qemu_input_event_sync
in qemu_input_event_sync(), there is a check vm runstate, as below:

if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
    return;
}
On KVM platform, the usb tablet event will be return at there.

As for Xen, It's too later. After suspend vm, the qemu process can response the 
event
of usb tablet event. Because guest os's vcpus are paused, guest os cannot 
response 
interrupt injected by qemu. Then the interrupt will be lost.

> Not implementing PIRQ enable could be it, especially as the guest os
> seems to use it (otherwise your patch would have no effect).
> 
> The check for the PIRQ enable bit should be in uhci_update_irq though,
> and you should check the single bit only, not the whole legacy support
> register.
> 
Agreed. Thanks.

> cheers,
>   Gerd
> 
> 

Best regards,
-Gonglei
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.