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

Re: [Xen-devel] [PATCH 11/16] xen: arm: Add debug keyhandler to dump the physical GIC state.



On Wed, 2013-11-20 at 17:36 +0000, Julien Grall wrote:
> On 11/20/2013 02:48 PM, Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > ---
> >  xen/arch/arm/gic.c |   75 
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 75 insertions(+)
> > 
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index ab49106..185a6b8 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -28,6 +28,7 @@
> >  #include <xen/softirq.h>
> >  #include <xen/list.h>
> >  #include <xen/device_tree.h>
> > +#include <xen/keyhandler.h>
> >  #include <asm/p2m.h>
> >  #include <asm/domain.h>
> >  
> > @@ -385,6 +386,77 @@ int gic_irq_xlate(const u32 *intspec, unsigned int 
> > intsize,
> >      return 0;
> >  }
> >  
> > +
> > +static void do_dump_gic(unsigned char key)
> > +{
> > +    int irq;
> > +    printk("'%c' pressed -> dumping GIC state\n", key);
> > +
> > +    for ( irq = 0; irq < gic.lines; irq++ )
> > +    {
> > +        const char *type;
> > +        int type_nr, enable, pend, active, priority, target;
> > +        struct irq_desc *desc = irq_to_desc(irq);
> > +        uint8_t *bytereg;
> > +        uint32_t wordreg;
> > +
> > +        bytereg = (uint8_t *) (GICD + GICD_ITARGETSR);
> > +        target = bytereg[irq];
> > +
> > +        bytereg = (uint8_t *) (GICD + GICD_IPRIORITYR);
> > +        priority = bytereg[irq];
> > +
> > +        switch ( irq )
> > +        {
> > +        case 0 ... 15:
> > +            type = "SGI";
> > +            type_nr = irq;
> > +            target = 0x00; /* these are per-CPU */
> > +            break;
> > +        case 16 ... 31:
> > +            type = "PPI";
> > +            type_nr = irq - 16;
> > +            break;
> 
> I think it's a bit stupid to print SGI and PPI as it's per-CPU
> interrupt. With your solution, you don't know which CPU call the keyhandler.

Most of the things I was interested don't vary across the CPUs,
specifically who is receiving the interrupt (dom0 or Xen) and the
priority (which is either static or consistent across the CPUs by
design). The enable/pend/act flags are a bit bogus but that didn't
really matter to me at the time.

> Perhaps, you need to an SGI to each CPU?

I suppose I could but I didn't need this for my debugging so I didn't
implement it. I'd rather leave this until there is a need for that
functionality.

I don't much care if this patch goes in as is or not but I don't want to
spend lots more time on it.

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