[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: Remove MSI boot parameter -- now always on.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1221040066 -3600
# Node ID 65dc37be0443e856d53e3a1f0c9f8f4a8999b851
# Parent  7f1c71c6d4c8814eb9d9f1f23d493d9edebd1a1e
x86: Remove MSI boot parameter -- now always on.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/io_apic.c        |   13 +------
 xen/arch/x86/physdev.c        |   70 +++++++++++++++---------------------------
 xen/include/asm-x86/io_apic.h |    2 -
 3 files changed, 27 insertions(+), 58 deletions(-)

diff -r 7f1c71c6d4c8 -r 65dc37be0443 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Tue Sep 09 17:28:05 2008 +0100
+++ b/xen/arch/x86/io_apic.c    Wed Sep 10 10:47:46 2008 +0100
@@ -45,23 +45,14 @@ int (*ioapic_renumber_irq)(int ioapic, i
 int (*ioapic_renumber_irq)(int ioapic, int irq);
 atomic_t irq_mis_count;
 
-int msi_enable = 0;
-boolean_param("msi", msi_enable);
-
 int domain_irq_to_vector(struct domain *d, int irq)
 {
-    if ( !msi_enable )
-        return irq_to_vector(irq);
-    else
-        return d->arch.pirq_vector[irq];
+    return d->arch.pirq_vector[irq];
 }
 
 int domain_vector_to_irq(struct domain *d, int vector)
 {
-    if ( !msi_enable )
-        return vector_to_irq(vector);
-    else
-        return d->arch.vector_pirq[vector];
+    return d->arch.vector_pirq[vector];
 }
 
 /* Where if anywhere is the i8259 connect in external int mode */
diff -r 7f1c71c6d4c8 -r 65dc37be0443 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Tue Sep 09 17:28:05 2008 +0100
+++ b/xen/arch/x86/physdev.c    Wed Sep 10 10:47:46 2008 +0100
@@ -136,8 +136,9 @@ done:
 /* The pirq should have been unbound before this call. */
 static int unmap_domain_pirq(struct domain *d, int pirq)
 {
-    int ret = 0;
-    int vector;
+    unsigned long flags;
+    irq_desc_t *desc;
+    int vector, ret = 0;
 
     if ( d == NULL || pirq < 0 || pirq >= NR_PIRQS )
         return -EINVAL;
@@ -154,33 +155,29 @@ static int unmap_domain_pirq(struct doma
         gdprintk(XENLOG_G_ERR, "domain %X: pirq %x not mapped still\n",
                  d->domain_id, pirq);
         ret = -EINVAL;
-    }
-    else
-    {
-        unsigned long flags;
-        irq_desc_t *desc;
-
-        desc = &irq_desc[vector];
-        spin_lock_irqsave(&desc->lock, flags);
-        if ( desc->msi_desc )
-            pci_disable_msi(vector);
-
-        if ( desc->handler == &pci_msi_type )
-        {
-            /* MSI is not shared, so should be released already */
-            BUG_ON(desc->status & IRQ_GUEST);
-            irq_desc[vector].handler = &no_irq_type;
-        }
-        spin_unlock_irqrestore(&desc->lock, flags);
-
-        d->arch.pirq_vector[pirq] = d->arch.vector_pirq[vector] = 0;
-    }
+        goto done;
+    }
+
+    desc = &irq_desc[vector];
+    spin_lock_irqsave(&desc->lock, flags);
+    if ( desc->msi_desc )
+        pci_disable_msi(vector);
+
+    if ( desc->handler == &pci_msi_type )
+    {
+        /* MSI is not shared, so should be released already */
+        BUG_ON(desc->status & IRQ_GUEST);
+        irq_desc[vector].handler = &no_irq_type;
+    }
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    d->arch.pirq_vector[pirq] = d->arch.vector_pirq[vector] = 0;
 
     ret = irq_deny_access(d, pirq);
-
     if ( ret )
         gdprintk(XENLOG_G_ERR, "deny irq %x access failed\n", pirq);
 
+ done:
     return ret;
 }
 
@@ -189,10 +186,6 @@ static int physdev_map_pirq(struct physd
     struct domain *d;
     int vector, pirq, ret = 0;
     unsigned long flags;
-
-    /* if msi_enable is not enabled, map always succeeds */
-    if ( !msi_enable )
-        return 0;
 
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -303,14 +296,8 @@ static int physdev_unmap_pirq(struct phy
     unsigned long flags;
     int ret;
 
-    if ( !msi_enable )
-        return 0;
-
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
-
-    if ( !unmap )
-        return -EINVAL;
 
     if ( unmap->domid == DOMID_SELF )
         d = rcu_lock_domain(current->domain);
@@ -318,14 +305,12 @@ static int physdev_unmap_pirq(struct phy
         d = rcu_lock_domain_by_id(unmap->domid);
 
     if ( d == NULL )
-    {
-        rcu_unlock_domain(d);
         return -ESRCH;
-    }
 
     spin_lock_irqsave(&d->arch.irq_lock, flags);
     ret = unmap_domain_pirq(d, unmap->pirq);
     spin_unlock_irqrestore(&d->arch.irq_lock, flags);
+
     rcu_unlock_domain(d);
 
     return ret;
@@ -452,14 +437,9 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
 
         irq_op.vector = assign_irq_vector(irq);
 
-        ret = 0;
-
-        if ( msi_enable )
-        {
-            spin_lock_irqsave(&dom0->arch.irq_lock, flags);
-            ret = map_domain_pirq(dom0, irq_op.irq, irq_op.vector, NULL);
-            spin_unlock_irqrestore(&dom0->arch.irq_lock, flags);
-        }
+        spin_lock_irqsave(&dom0->arch.irq_lock, flags);
+        ret = map_domain_pirq(dom0, irq_op.irq, irq_op.vector, NULL);
+        spin_unlock_irqrestore(&dom0->arch.irq_lock, flags);
 
         if ( copy_to_guest(arg, &irq_op, 1) != 0 )
             ret = -EFAULT;
diff -r 7f1c71c6d4c8 -r 65dc37be0443 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h     Tue Sep 09 17:28:05 2008 +0100
+++ b/xen/include/asm-x86/io_apic.h     Wed Sep 10 10:47:46 2008 +0100
@@ -162,8 +162,6 @@ static inline void io_apic_modify(unsign
 /* 1 if "noapic" boot option passed */
 extern int skip_ioapic_setup;
 
-extern int msi_enable;
-
 /*
  * If we use the IO-APIC for IRQ routing, disable automatic
  * assignment of PCI IRQ's.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.