From: Ian Campbell Subject: Re: Stack switching in a PV guest Date: Mon, 16 Dec 2013 13:36:09 +0000 Message-ID: <1387200969.10247.36.camel@kazak.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Simon Martin Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 2013-12-16 at 13:31 +0000, Simon Martin wrote: > Hi all, > > I am currently trying to implement multitasking inside my little PV. > This is done by a a simple stack switch. > > Whenever I touch the stack in the PV it crashes. I assume that this is > due to the iret at the end of the event handler returning control to > the Hypervisor. Can anyone point me in the right direction to sort > this out please. Need more details of what you have done to advise properly I think. Perhaps you need to be using HYPERVISOR_iret, or perhaps you need to make sure that your stack frame actually returns you to the correct context (which I expect hypervisor context is not). Ian.