All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "Keir (Xen.org)" <keir@xen.org>,
	Marek Marczykowski <marmarek@invisiblethingslab.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86: irq_move_cleanup_interrupt() must ignore legacy vectors
Date: Thu, 28 Mar 2013 15:29:46 +0000	[thread overview]
Message-ID: <515461EA.509@citrix.com> (raw)
In-Reply-To: <51546EB902000078000C95B2@nat28.tlf.novell.com>

On 28/03/2013 15:24, Jan Beulich wrote:
> Since the main loop in the function includes legacy vectors, and since
> vector_irq[] gets set up for legacy vectors regardless of whether those
> get handled through the IO-APIC, it must not do anything on this vector
> range. In fact, we should never get here for IRQs not handled through
> the IO-APIC, so add a respective assertion at once. For that assertion
> to not have false positives we however need to suppress setting up IRQ2
> as an 8259A interrupt (which wasn't correct anyway).
>
> Furthermore, there's no point iterating over the vectors past
> LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/i8259.c
> +++ b/xen/arch/x86/i8259.c
> @@ -416,6 +416,8 @@ void __init init_IRQ(void)
>      for (irq = 0; platform_legacy_irq(irq); irq++) {
>          struct irq_desc *desc = irq_to_desc(irq);
>          
> +        if ( irq == 2 ) /* IRQ2 doesn't exist */
> +            continue;
>          desc->handler = &i8259A_irq_type;
>          per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
>          cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -616,7 +616,9 @@ void irq_move_cleanup_interrupt(struct c
>      ack_APIC_irq();
>  
>      me = smp_processor_id();
> -    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
> +    for ( vector = FIRST_DYNAMIC_VECTOR;
> +          vector <= LAST_HIPRIORITY_VECTOR; vector++)
> +    {
>          unsigned int irq;
>          unsigned int irr;
>          struct irq_desc *desc;
> @@ -625,6 +627,12 @@ void irq_move_cleanup_interrupt(struct c
>          if ((int)irq < 0)
>              continue;
>  
> +        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
> +        {
> +            ASSERT(IO_APIC_IRQ(irq));
> +            continue;
> +        }
> +
>          desc = irq_to_desc(irq);
>          if (!desc)
>              continue;
>
>
>

  reply	other threads:[~2013-03-28 15:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 15:24 [PATCH] x86: irq_move_cleanup_interrupt() must ignore legacy vectors Jan Beulich
2013-03-28 15:29 ` Andrew Cooper [this message]
2013-03-28 19:58 ` Keir Fraser
2013-04-02  6:25   ` 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=515461EA.509@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=marmarek@invisiblethingslab.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.