xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: suppress pointless Xen messages from ioapic_guest_write()
@ 2010-03-17 11:39 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-03-17 11:39 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]

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 <jbeulich@novell.com>

--- 2010-03-02.orig/xen/arch/x86/io_apic.c	2010-03-17 12:02:43.000000000 +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
     
     if ( desc->action )
     {
-        WARN_BOGUS_WRITE("Attempt to modify IO-APIC pin for in-use IRQ!\n");
+        spin_lock_irqsave(&ioapic_lock, flags);
+        ret = io_apic_read(apic, 0x10 + 2 * pin);
+        spin_unlock_irqrestore(&ioapic_lock, flags);
+        rte.vector = cfg->vector;
+        if ( *(u32*)&rte != ret )
+            WARN_BOGUS_WRITE("old_entry=%08x pirq=%d\n%s: "
+                             "Attempt to modify IO-APIC pin for in-use IRQ!\n",
+                             ret, pirq, __FUNCTION__);
         return 0;
     }
 
     if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {
-
-        printk("allocated vector for irq:%d\n", irq);
-        
         vector = assign_irq_vector(irq);
         if ( vector < 0 )
             return vector;
 
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+
         add_pin_to_irq(irq, apic, pin);
     }
     spin_lock(&pcidevs_lock);




[-- Attachment #2: x86-ioapic-guest-write.patch --]
[-- Type: text/plain, Size: 1570 bytes --]

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 <jbeulich@novell.com>

--- 2010-03-02.orig/xen/arch/x86/io_apic.c	2010-03-17 12:02:43.000000000 +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
     
     if ( desc->action )
     {
-        WARN_BOGUS_WRITE("Attempt to modify IO-APIC pin for in-use IRQ!\n");
+        spin_lock_irqsave(&ioapic_lock, flags);
+        ret = io_apic_read(apic, 0x10 + 2 * pin);
+        spin_unlock_irqrestore(&ioapic_lock, flags);
+        rte.vector = cfg->vector;
+        if ( *(u32*)&rte != ret )
+            WARN_BOGUS_WRITE("old_entry=%08x pirq=%d\n%s: "
+                             "Attempt to modify IO-APIC pin for in-use IRQ!\n",
+                             ret, pirq, __FUNCTION__);
         return 0;
     }
 
     if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {
-
-        printk("allocated vector for irq:%d\n", irq);
-        
         vector = assign_irq_vector(irq);
         if ( vector < 0 )
             return vector;
 
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+
         add_pin_to_irq(irq, apic, pin);
     }
     spin_lock(&pcidevs_lock);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-17 11:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 11:39 [PATCH] x86: suppress pointless Xen messages from ioapic_guest_write() Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).