From: Ian Campbell Subject: Re: [PATCH 22/38] arm: implement vcpu_show_execution_state Date: Wed, 20 Jun 2012 14:56:04 +0100 Message-ID: <1340200564.4906.61.camel@zakaz.uk.xensource.com> References: <1338565113.17466.141.camel@zakaz.uk.xensource.com> <1338565207-2888-1-git-send-email-ian.campbell@citrix.com> <1338565207-2888-22-git-send-email-ian.campbell@citrix.com> <1340200398.4906.60.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1340200398.4906.60.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-06-20 at 14:53 +0100, Ian Campbell wrote: > On Wed, 2012-06-06 at 18:26 +0100, Stefano Stabellini wrote: > > > @@ -334,6 +360,26 @@ void show_execution_state(struct cpu_user_regs *regs) > > > show_stack(regs); > > > } > > > > > > +void vcpu_show_execution_state(struct vcpu *v) > > > +{ > > > + printk("*** Dumping Dom%d vcpu#%d state: ***\n", > > > + v->domain->domain_id, v->vcpu_id); > > > + > > > + if ( v == current ) > > > + { > > > + show_execution_state(guest_cpu_user_regs()); > > > + return; > > > + } > > > + > > > + vcpu_pause(v); /* acceptably dangerous */ > > > + > > > + vcpu_show_registers(v); > > > + if ( !usr_mode(&v->arch.cpu_info->guest_cpu_user_regs) ) > > > + show_guest_stack(&v->arch.cpu_info->guest_cpu_user_regs); > > > > isn't the if condition inverted? > > I think what I'm trying to do here is only dump the stack if the guest > was in one of the privileged modes (i.e. not user mode). > > I don't really recall why -- I guess I figured the usermode stack was > not likely to be all that useful. It looks like I just copied the behaviour of x86, which has: if ( guest_kernel_mode(v, &v->arch.user_regs) ) show_guest_stack(v, &v->arch.user_regs); Ian.