|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: lazy context switching
On Friday 26 August 2005 13:06, Keir Fraser wrote:
> 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.
I think this could work, in conjunction with using the HDEC timer solely as a
context-switch interrupt (so saving all nonvolatiles on HDEC).
However, if we ever want to context switch for other reasons (e.g. a "yield"
hypercall), we're back to the same problem: the hcall exception handler won't
save the nonvolatiles...
--
Hollis Blanchard
IBM Linux Technology Center
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|