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

Re: [Xen-devel] [PATCH 08/38] arm: allocate and setup a guest vcpu.



On Wed, 2012-06-06 at 14:55 +0100, Ian Campbell wrote:
> On Wed, 2012-06-06 at 14:46 +0100, Stefano Stabellini wrote:
> > On Fri, 1 Jun 2012, Ian Campbell wrote:
> > > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > > ---
> > >  xen/arch/arm/domain.c         |   68 
> > > +++++++++++++++++++++++++++++++++++++++++
> > >  xen/arch/arm/dummy.S          |    3 --
> > >  xen/include/public/arch-arm.h |    9 -----
> > >  3 files changed, 68 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > > index 9339a11..62a2f3a 100644
> > > --- a/xen/arch/arm/domain.c
> > > +++ b/xen/arch/arm/domain.c
> > > @@ -144,6 +144,17 @@ void free_vcpu_struct(struct vcpu *v)
> > >      free_xenheap_page(v);
> > >  }
> > >  
> > > +struct vcpu_guest_context *alloc_vcpu_guest_context(void)
> > > +{
> > > +    return xmalloc(struct vcpu_guest_context);
> > > +
> > > +}
> > > +
> > > +void free_vcpu_guest_context(struct vcpu_guest_context *vgc)
> > > +{
> > > +    xfree(vgc);
> > > +}
> > > +
> > >  int vcpu_initialise(struct vcpu *v)
> > >  {
> > >      int rc = 0;
> > > @@ -182,6 +193,9 @@ int arch_domain_create(struct domain *d, unsigned int 
> > > domcr_flags)
> > >      if ( (rc = p2m_init(d)) != 0 )
> > >          goto fail;
> > >  
> > > +    if ( (rc = domain_vgic_init(d)) != 0 )
> > > +        goto fail;
> > > +
> > 
> > there is a call to domain_vgic_init already in arch_domain_create
> 
> So there is!

Rather inexplicably removing either one of those two domain_vgic_init
calls causes:
        (XEN) Unexpected Trap: Data Abort
        (XEN) ----[ Xen-4.2-unstable  x86_64  debug=y  Not tainted ]----
        (XEN) CPU:    0
        (XEN) PC:     00222e7c _spin_lock+0x28/0x6c
        (XEN) CPSR:   600001da MODE:HYP
        (XEN)      R0: 002c4389 R1: 800001da R2: 00000001 R3: 0000ffff
        (XEN)      R4: 002c4381 R5: 00000080 R6: 002c4380 R7: 002c4000
        (XEN)      R8: 002c4380 R9: 4000015a R10:00000080 R11:40017d6c 
R12:00000000
        (XEN)      SP: 40017d5c LR: 00222e68
        (XEN) 
        (XEN) HTTBR ffec1000
        (XEN) HDFAR 2c4381
        (XEN) HIFAR 0
        (XEN) HPFAR 0
        (XEN) HCR 00000835
        (XEN) HSR   94000021
        (XEN) 
        (XEN) DFSR 817 DFAR 134bc
        (XEN) IFSR 7 IFAR 4024c224
        (XEN) 
        (XEN) Xen stack trace from sp=40017d5c:
        [...]
        (XEN) Xen call trace:
        (XEN)    [<00222e7c>] _spin_lock+0x28/0x6c
        (XEN)    [<00226270>] init_timer+0xbc/0x160
        (XEN)    [<0021fc14>] sched_init_vcpu+0x94/0x200
        (XEN)    [<002061a4>] alloc_vcpu+0x124/0x210
        (XEN)    [<00204890>] do_domctl+0xaa4/0x14e4
        (XEN)    [<00241aec>] do_trap_hypervisor+0x588/0x8cc
        (XEN)    [<0023bbf0>] return_from_trap+0x0/0x4

I'm totally at a loss to explain that. domain_vgic_init allocates two
arrays so it is possible we have some sort of overrun error, although I
can't for the life of me see it in there (it could be elsewhere though).

As an experiment I tried doubling the size of both allocations in that
function (and calling it once) but that didn't help so no hints from
that...

More head scratching required I think!

Ian.


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