From: "Jan Beulich" Subject: Re: Stack switching in a PV guest Date: Mon, 16 Dec 2013 14:45:10 +0000 Message-ID: <52AF2006020000780010DC0D@nat28.tlf.novell.com> References: <1387200969.10247.36.camel@kazak.uk.xensource.com> <121927688.20131216105010@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <121927688.20131216105010@gmail.com> Content-Disposition: inline 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: Simon Martin , Ian Campbell , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 16.12.13 at 14:50, Simon Martin wrote: > I have checked using gdb and when it gets to the iretq statement in > HYPERVISOR_iret the stack is as follows > > %rsp -> valid instruction pointer > %rsp+8 -> same CS as the original stack frame. > %rsp+16 -> 0 (initial rFLAGS) %rsp+24 -> ??? %rsp+32 -> ??? Those two are the crucial fields when you're having stack issues. 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. Jan