WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: lazy context switching


On 26 Aug 2005, at 18:40, Hollis Blanchard wrote:

context_switch() will be called from somewhere beneath c_handler(). At that point, the original nonvolatiles will have been saved across many stack frames (starting with c_handler()'s), so we really are unable to access them at this point. However, we trust that by the time we get back to the exception handler, the original nonvolatiles will have been restored off all those stack frames.

Hmmmm... Anyone interested in the state of a paused vcpu will call sync_vcpu_execstate() after descheduling the vcpu. That is an entirely arch-specific function that you can define to wait until the non-volatile registers are safely saved to memory.

Maybe you could add a flag to the arch-specific portion of the vcpu structure that gets set after the non-volatile registers are saved to memory and cleared when they are restored to active use. Then sync_vcpu_execstate() can spin on that flag waiting for it to be non-zero.

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel