All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86: extend diagnostics for "No irq handler for vector" messages
Date: Wed, 13 Mar 2013 15:00:29 +0000	[thread overview]
Message-ID: <CD66450D.4D906%keir.xen@gmail.com> (raw)
In-Reply-To: <514083CE02000078000C5574@nat28.tlf.novell.com>

On 13/03/2013 12:49, "Jan Beulich" <JBeulich@suse.com> wrote:

> By storing the inverted IRQ number in vector_irq[], we may be able to
> spot which IRQ a vector was used for most recently, thus hopefully
> permitting to understand why these messages trigger on certain systems.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/i8259.c
> +++ b/xen/arch/x86/i8259.c
> @@ -165,7 +165,7 @@ static void _disable_8259A_irq(unsigned
>          outb(cached_A1,0xA1);
>      else
>          outb(cached_21,0x21);
> -    per_cpu(vector_irq, 0)[LEGACY_VECTOR(irq)] = -1;
> +    per_cpu(vector_irq, 0)[LEGACY_VECTOR(irq)] = ~irq;
>      spin_unlock_irqrestore(&i8259A_lock, flags);
>  }
>  
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -227,7 +227,7 @@ static void __clear_irq_vector(int irq)
>  
>      for_each_cpu(cpu, &tmp_mask) {
>          ASSERT( per_cpu(vector_irq, cpu)[vector] == irq );
> -        per_cpu(vector_irq, cpu)[vector] = -1;
> +        per_cpu(vector_irq, cpu)[vector] = ~irq;
>      }
>  
>      desc->arch.vector = IRQ_VECTOR_UNASSIGNED;
> @@ -253,8 +253,8 @@ static void __clear_irq_vector(int irq)
>      for_each_cpu(cpu, &tmp_mask) {
>          ASSERT( per_cpu(vector_irq, cpu)[old_vector] == irq );
>          TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, old_vector, cpu);
> -        per_cpu(vector_irq, cpu)[old_vector] = -1;
> -     }
> +        per_cpu(vector_irq, cpu)[old_vector] = ~irq;
> +    }
>  
>      desc->arch.old_vector = IRQ_VECTOR_UNASSIGNED;
>      cpumask_clear(desc->arch.old_cpu_mask);
> @@ -334,7 +334,7 @@ int __init init_irq_data(void)
>      int irq, vector;
>  
>      for (vector = 0; vector < NR_VECTORS; ++vector)
> -        this_cpu(vector_irq)[vector] = -1;
> +        this_cpu(vector_irq)[vector] = INT_MIN;
>  
>      irq_desc = xzalloc_array(struct irq_desc, nr_irqs);
>      
> @@ -489,7 +489,7 @@ next:
>              goto next;
>  
>          for_each_cpu(new_cpu, &tmp_mask)
> -            if (per_cpu(vector_irq, new_cpu)[vector] != -1)
> +            if (per_cpu(vector_irq, new_cpu)[vector] >= 0)
>                  goto next;
>          /* Found one! */
>          current_vector = vector;
> @@ -551,7 +551,7 @@ void __setup_vector_irq(int cpu)
>  
>      /* Clear vector_irq */
>      for (vector = 0; vector < NR_VECTORS; ++vector)
> -        per_cpu(vector_irq, cpu)[vector] = -1;
> +        per_cpu(vector_irq, cpu)[vector] = INT_MIN;
>      /* Mark the inuse vectors */
>      for (irq = 0; irq < nr_irqs; ++irq) {
>          struct irq_desc *desc = irq_to_desc(irq);
> @@ -622,7 +622,7 @@ void irq_move_cleanup_interrupt(struct c
>          struct irq_desc *desc;
>          irq = __get_cpu_var(vector_irq)[vector];
>  
> -        if (irq == -1)
> +        if ((int)irq < 0)
>              continue;
>  
>          desc = irq_to_desc(irq);
> @@ -655,7 +655,7 @@ void irq_move_cleanup_interrupt(struct c
>          TRACE_3D(TRC_HW_IRQ_MOVE_CLEANUP,
>                   irq, vector, smp_processor_id());
>  
> -        __get_cpu_var(vector_irq)[vector] = -1;
> +        __get_cpu_var(vector_irq)[vector] = ~irq;
>          desc->arch.move_cleanup_count--;
>  
>          if ( desc->arch.move_cleanup_count == 0 )
> @@ -819,8 +819,22 @@ void do_IRQ(struct cpu_user_regs *regs)
>              if ( ! ( vector >= FIRST_LEGACY_VECTOR &&
>                       vector <= LAST_LEGACY_VECTOR &&
>                       bogus_8259A_irq(vector - FIRST_LEGACY_VECTOR) ) )
> +            {
>                  printk("CPU%u: No irq handler for vector %02x (IRQ %d%s)\n",
>                         smp_processor_id(), vector, irq, kind);
> +                desc = irq_to_desc(~irq);
> +                if ( ~irq < nr_irqs && irq_desc_initialized(desc) )
> +                {
> +                    spin_lock(&desc->lock);
> +                    printk("IRQ%d a=%04lx[%04lx,%04lx] v=%02x[%02x] t=%-15s
> s=%08x\n",
> +                           ~irq, *cpumask_bits(desc->affinity),
> +                           *cpumask_bits(desc->arch.cpu_mask),
> +                           *cpumask_bits(desc->arch.old_cpu_mask),
> +                           desc->arch.vector, desc->arch.old_vector,
> +                           desc->handler->typename, desc->status);
> +                    spin_unlock(&desc->lock);
> +                }
> +            }
>              TRACE_1D(TRC_HW_IRQ_UNMAPPED_VECTOR, vector);
>          }
>          goto out_no_unlock;
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-03-13 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 12:49 [PATCH] x86: extend diagnostics for "No irq handler for vector" messages Jan Beulich
2013-03-13 13:11 ` Andrew Cooper
2013-03-13 15:00 ` Keir Fraser [this message]
2013-03-15  8:46 ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CD66450D.4D906%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.