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

Re: [Xen-devel] Stack switching in a PV guest



On Fri, 20 Dec 2013 14:12:55 +0000
"Simon Martin" <smartin@xxxxxxxxxxxx> wrote:

> Hi Jan
> 
> 
> >>  Furthermore, the guest's kernel stack wants to be switched via
> >>  __HYPERVISOR_stack_switch, or else the next interrupt/exception
> >>  would end up still using the old stack.
> I think I've finally got my head round using HYPERVISOR_stack_switch.
> It seems to replace all my stack magic, and at least it's not
> crashing now.
> 
> However, I now have a different problem. I am running my context
> switch off of a single shot timer. When the timer fires Xen transfers
> control to my PV guest via the hypercall_callback.
> 
> The hypercall_callback handler stores the current CPU register file, 
> however the stored rsp always points to the hypercall stack, not the 
> stack that was active in my PV at the moment the timer event fired.
> 
> I need to store the PV stack pointer so I can recover it later when
> my scheduler activates it. I have looked back up the stack and I
> don't really see where my active stack pointer is. Any idea where I
> can get it?
> 
> Regards.

May I recommend taking a look at PVH, it would simplify things a
lot for you. Take a look at what linux PVH does, you could start with
linux PVH patches:

"[PATCH v11] PVH support for Linux kernel." email by konrad on
xen-devel.

If you have any questions, I can help, next year tho.

Mukesh


_______________________________________________
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®.