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

Re: [Xen-devel] [PATCH 22/38] arm: implement vcpu_show_execution_state



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. Unless there's some reason (which I've
forgotten) why we can't walk guest userspace stacks, but given that the
entirety of the implementation of show_guest_stack() is:
        static void show_guest_stack(struct cpu_user_regs *regs)
        {
            printk("GUEST STACK GOES HERE\n");
        }
I guess it doesn't really matter ;-)

Ian.
> 
> > +    vcpu_unpause(v);
> > +}
> > +
> >  static void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
> >  {
> >      printk("Unexpected Trap: %s\n", msg);
> 



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