From: "Jan Beulich" Subject: Re: IRQ migration (c/s 20370 + 20465) Date: Tue, 30 Nov 2010 16:53:35 +0000 Message-ID: <4CF53A200200007800024F4D@vpn.id2.novell.com> References: <4CF3B55A0200007800024A99@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4CF3B55A0200007800024A99@vpn.id2.novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: edwin.zhai@intel.com, xiantao.zhang@intel.com Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 29.11.10 at 14:14, "Jan Beulich" wrote: > Edwin, Xiantao, >=20 > I'm observing I/O-APIC IRQs never getting migrated on a system > using directed EOI. Looking at end_level_ioapic_irq(), I fail > to see how that case is being handled (other than in the Linux > implementation, which this code supposedly is a clone of). >=20 > Additionally it seems wasteful to check whether to move the IRQ in > mask_and_ack_level_ioapic_irq(), as ack_APIC_irq() cannot > possibly have resulted in clearing any of the IRR bits that > io_apic_level_ack_pending() is looking at. Below is a tentative (lightly tested) fix for this. Comments? Jan --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -1634,11 +1634,14 @@ static void mask_and_ack_level_ioapic_ir =20 ack_APIC_irq(); =20 + if ( directed_eoi_enabled ) + return; + if ((irq_desc[irq].status & IRQ_MOVE_PENDING) && !io_apic_level_ack_pending(irq)) - move_native_irq(irq); + move_masked_irq(irq); =20 - if (!directed_eoi_enabled && !(v & (1 << (i & 0x1f)))) { + if ( !(v & (1 << (i & 0x1f))) ) { atomic_inc(&irq_mis_count); spin_lock(&ioapic_lock); __edge_IO_APIC_irq(irq); @@ -1654,12 +1657,22 @@ static void end_level_ioapic_irq (unsign =20 if ( !ioapic_ack_new ) { - if ( irq_desc[irq].status & IRQ_DISABLED ) - return; - if ( directed_eoi_enabled ) + { + if ( !(irq_desc[irq].status & (IRQ_DISABLED|IRQ_MOVE_PENDING))= ) + { + eoi_IO_APIC_irq(irq); + return; + } + + mask_IO_APIC_irq(irq); eoi_IO_APIC_irq(irq); - else + if ( (irq_desc[irq].status & IRQ_MOVE_PENDING) && + !io_apic_level_ack_pending(irq) ) + move_masked_irq(irq); + } + + if ( !(irq_desc[irq].status & IRQ_DISABLED) ) unmask_IO_APIC_irq(irq); =20 return;