All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: xen-devel@lists.xensource.com, Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH] x86: clean up __io_apic_eoi()
Date: Fri, 11 Nov 2011 16:49:23 +0000	[thread overview]
Message-ID: <4EBD5213.3030407@citrix.com> (raw)
In-Reply-To: <4EBD5639020000780006077C@nat28.tlf.novell.com>

On 11/11/11 16:07, Jan Beulich wrote:
> Irrespective of the IO-APIC vector sharing suppression patch just sent
> the logic in this function needs to iterate over all RTEs, since
> multiple pins within an IO-APIC may still use the same vector.

Why?  The whole point of preventing vector sharing for IO-APICs is to
prevent two or more RTEs referencing the same vector.

~Andrew

>  This is
> due to the irq_2_pin[] mapping not necessarily being 1:1.
>
> Consequently we should remove the commented out code as well as the
> respective comments provisioned for the point in time when vector
> sharing between unrelated RTEs would be disabled.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -281,36 +281,15 @@ static void __io_apic_eoi(unsigned int a
>          /* If pin is unknown, search for it */
>          if ( pin == -1 )
>          {
> -            unsigned int p;
> -            for ( p = 0; p < nr_ioapic_entries[apic]; ++p )
> +            for ( pin = 0; pin < nr_ioapic_entries[apic]; ++pin )
>              {
> -                entry = __ioapic_read_entry(apic, p, TRUE);
> +                entry = __ioapic_read_entry(apic, pin, TRUE);
>                  if ( entry.vector == vector )
> -                {
> -                    pin = p;
> -                    /* break; */
> -
> -                    /* Here should be a break out of the loop, but at the 
> -                     * Xen code doesn't actually prevent multiple IO-APIC
> -                     * entries being assigned the same vector, so EOI all
> -                     * pins which have the correct vector.
> -                     *
> -                     * Remove the following code when the above assertion
> -                     * is fulfilled. */
> -                    __io_apic_eoi(apic, vector, p);
> -                }
> +                    __io_apic_eoi(apic, vector, pin);
>              }
>              
>              /* If search fails, nothing to do */
>  
> -            /* if ( pin == -1 ) */
> -
> -            /* Because the loop wasn't broken out of (see comment above),
> -             * all relevant pins have been EOI, so we can always return.
> -             * 
> -             * Re-instate the if statement above when the Xen logic has been
> -             * fixed.*/
> -
>              return;
>          }
>  
>
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

  reply	other threads:[~2011-11-11 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 16:07 [PATCH] x86: clean up __io_apic_eoi() Jan Beulich
2011-11-11 16:49 ` Andrew Cooper [this message]
2011-11-14  9:08   ` Jan Beulich
2011-11-14 14:07     ` Andrew Cooper
2011-11-14 14:14       ` 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=4EBD5213.3030407@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xensource.com \
    /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.