From: "Jan Beulich" Subject: [PATCH] x86: suppress pointless Xen messages from ioapic_guest_write() Date: Wed, 17 Mar 2010 11:39:55 +0000 Message-ID: <4BA0CD9B02000078000357B8@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartA78D419B.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartA78D419B.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Previously, these messages were only issued when old and new RTE differed. Make it so again (requiring adjustment of the guest provided RTE as that no longer holds a real vector). While at it, also make the "allocated vector for irq" message more useful and occur when what it says really happened. Signed-off-by: Jan Beulich --- 2010-03-02.orig/xen/arch/x86/io_apic.c 2010-03-17 12:02:43.0000000= 00 +0100 +++ 2010-03-02/xen/arch/x86/io_apic.c 2010-03-17 12:08:06.000000000 = +0100 @@ -2282,18 +2282,24 @@ int ioapic_guest_write(unsigned long phy =20 if ( desc->action ) { - WARN_BOGUS_WRITE("Attempt to modify IO-APIC pin for in-use = IRQ!\n"); + spin_lock_irqsave(&ioapic_lock, flags); + ret =3D io_apic_read(apic, 0x10 + 2 * pin); + spin_unlock_irqrestore(&ioapic_lock, flags); + rte.vector =3D cfg->vector; + if ( *(u32*)&rte !=3D ret ) + WARN_BOGUS_WRITE("old_entry=3D%08x pirq=3D%d\n%s: " + "Attempt to modify IO-APIC pin for in-use = IRQ!\n", + ret, pirq, __FUNCTION__); return 0; } =20 if ( cfg->vector <=3D 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) { - - printk("allocated vector for irq:%d\n", irq); - =20 vector =3D assign_irq_vector(irq); if ( vector < 0 ) return vector; =20 + printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, = irq); + add_pin_to_irq(irq, apic, pin); } spin_lock(&pcidevs_lock); --=__PartA78D419B.0__= Content-Type: text/plain; name="x86-ioapic-guest-write.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-ioapic-guest-write.patch" Previously, these messages were only issued when old and new RTE=0Adiffered= . Make it so again (requiring adjustment of the guest provided=0ARTE as = that no longer holds a real vector).=0A=0AWhile at it, also make the = "allocated vector for irq" message more=0Auseful and occur when what it = says really happened.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- 2010-03-02.orig/xen/arch/x86/io_apic.c 2010-03-17 = 12:02:43.000000000 +0100=0A+++ 2010-03-02/xen/arch/x86/io_apic.c = 2010-03-17 12:08:06.000000000 +0100=0A@@ -2282,18 +2282,24 @@ int = ioapic_guest_write(unsigned long phy=0A =0A if ( desc->action )=0A = {=0A- WARN_BOGUS_WRITE("Attempt to modify IO-APIC pin for = in-use IRQ!\n");=0A+ spin_lock_irqsave(&ioapic_lock, flags);=0A+ = ret =3D io_apic_read(apic, 0x10 + 2 * pin);=0A+ spin_unlock_irqr= estore(&ioapic_lock, flags);=0A+ rte.vector =3D cfg->vector;=0A+ = if ( *(u32*)&rte !=3D ret )=0A+ WARN_BOGUS_WRITE("old_entry= =3D%08x pirq=3D%d\n%s: "=0A+ "Attempt to = modify IO-APIC pin for in-use IRQ!\n",=0A+ = ret, pirq, __FUNCTION__);=0A return 0;=0A }=0A =0A if ( = cfg->vector <=3D 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {=0A-=0A- = printk("allocated vector for irq:%d\n", irq);=0A- =0A = vector =3D assign_irq_vector(irq);=0A if ( vector < 0 )=0A = return vector;=0A =0A+ printk(XENLOG_INFO "allocated vector = %02x for irq %d\n", vector, irq);=0A+=0A add_pin_to_irq(irq, apic, = pin);=0A }=0A spin_lock(&pcidevs_lock);=0A --=__PartA78D419B.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartA78D419B.0__=--