ia64/xen-unstable

changeset 18467:65dc37be0443

x86: Remove MSI boot parameter -- now always on.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Sep 10 10:47:46 2008 +0100 (2008-09-10)
parents 7f1c71c6d4c8
children b5912430e66c
files xen/arch/x86/io_apic.c xen/arch/x86/physdev.c xen/include/asm-x86/io_apic.h
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Tue Sep 09 17:28:05 2008 +0100
     1.2 +++ b/xen/arch/x86/io_apic.c	Wed Sep 10 10:47:46 2008 +0100
     1.3 @@ -45,23 +45,14 @@
     1.4  int (*ioapic_renumber_irq)(int ioapic, int irq);
     1.5  atomic_t irq_mis_count;
     1.6  
     1.7 -int msi_enable = 0;
     1.8 -boolean_param("msi", msi_enable);
     1.9 -
    1.10  int domain_irq_to_vector(struct domain *d, int irq)
    1.11  {
    1.12 -    if ( !msi_enable )
    1.13 -        return irq_to_vector(irq);
    1.14 -    else
    1.15 -        return d->arch.pirq_vector[irq];
    1.16 +    return d->arch.pirq_vector[irq];
    1.17  }
    1.18  
    1.19  int domain_vector_to_irq(struct domain *d, int vector)
    1.20  {
    1.21 -    if ( !msi_enable )
    1.22 -        return vector_to_irq(vector);
    1.23 -    else
    1.24 -        return d->arch.vector_pirq[vector];
    1.25 +    return d->arch.vector_pirq[vector];
    1.26  }
    1.27  
    1.28  /* Where if anywhere is the i8259 connect in external int mode */
     2.1 --- a/xen/arch/x86/physdev.c	Tue Sep 09 17:28:05 2008 +0100
     2.2 +++ b/xen/arch/x86/physdev.c	Wed Sep 10 10:47:46 2008 +0100
     2.3 @@ -136,8 +136,9 @@ done:
     2.4  /* The pirq should have been unbound before this call. */
     2.5  static int unmap_domain_pirq(struct domain *d, int pirq)
     2.6  {
     2.7 -    int ret = 0;
     2.8 -    int vector;
     2.9 +    unsigned long flags;
    2.10 +    irq_desc_t *desc;
    2.11 +    int vector, ret = 0;
    2.12  
    2.13      if ( d == NULL || pirq < 0 || pirq >= NR_PIRQS )
    2.14          return -EINVAL;
    2.15 @@ -154,33 +155,29 @@ static int unmap_domain_pirq(struct doma
    2.16          gdprintk(XENLOG_G_ERR, "domain %X: pirq %x not mapped still\n",
    2.17                   d->domain_id, pirq);
    2.18          ret = -EINVAL;
    2.19 -    }
    2.20 -    else
    2.21 -    {
    2.22 -        unsigned long flags;
    2.23 -        irq_desc_t *desc;
    2.24 -
    2.25 -        desc = &irq_desc[vector];
    2.26 -        spin_lock_irqsave(&desc->lock, flags);
    2.27 -        if ( desc->msi_desc )
    2.28 -            pci_disable_msi(vector);
    2.29 -
    2.30 -        if ( desc->handler == &pci_msi_type )
    2.31 -        {
    2.32 -            /* MSI is not shared, so should be released already */
    2.33 -            BUG_ON(desc->status & IRQ_GUEST);
    2.34 -            irq_desc[vector].handler = &no_irq_type;
    2.35 -        }
    2.36 -        spin_unlock_irqrestore(&desc->lock, flags);
    2.37 -
    2.38 -        d->arch.pirq_vector[pirq] = d->arch.vector_pirq[vector] = 0;
    2.39 +        goto done;
    2.40      }
    2.41  
    2.42 +    desc = &irq_desc[vector];
    2.43 +    spin_lock_irqsave(&desc->lock, flags);
    2.44 +    if ( desc->msi_desc )
    2.45 +        pci_disable_msi(vector);
    2.46 +
    2.47 +    if ( desc->handler == &pci_msi_type )
    2.48 +    {
    2.49 +        /* MSI is not shared, so should be released already */
    2.50 +        BUG_ON(desc->status & IRQ_GUEST);
    2.51 +        irq_desc[vector].handler = &no_irq_type;
    2.52 +    }
    2.53 +    spin_unlock_irqrestore(&desc->lock, flags);
    2.54 +
    2.55 +    d->arch.pirq_vector[pirq] = d->arch.vector_pirq[vector] = 0;
    2.56 +
    2.57      ret = irq_deny_access(d, pirq);
    2.58 -
    2.59      if ( ret )
    2.60          gdprintk(XENLOG_G_ERR, "deny irq %x access failed\n", pirq);
    2.61  
    2.62 + done:
    2.63      return ret;
    2.64  }
    2.65  
    2.66 @@ -190,10 +187,6 @@ static int physdev_map_pirq(struct physd
    2.67      int vector, pirq, ret = 0;
    2.68      unsigned long flags;
    2.69  
    2.70 -    /* if msi_enable is not enabled, map always succeeds */
    2.71 -    if ( !msi_enable )
    2.72 -        return 0;
    2.73 -
    2.74      if ( !IS_PRIV(current->domain) )
    2.75          return -EPERM;
    2.76  
    2.77 @@ -303,29 +296,21 @@ static int physdev_unmap_pirq(struct phy
    2.78      unsigned long flags;
    2.79      int ret;
    2.80  
    2.81 -    if ( !msi_enable )
    2.82 -        return 0;
    2.83 -
    2.84      if ( !IS_PRIV(current->domain) )
    2.85          return -EPERM;
    2.86  
    2.87 -    if ( !unmap )
    2.88 -        return -EINVAL;
    2.89 -
    2.90      if ( unmap->domid == DOMID_SELF )
    2.91          d = rcu_lock_domain(current->domain);
    2.92      else
    2.93          d = rcu_lock_domain_by_id(unmap->domid);
    2.94  
    2.95      if ( d == NULL )
    2.96 -    {
    2.97 -        rcu_unlock_domain(d);
    2.98          return -ESRCH;
    2.99 -    }
   2.100  
   2.101      spin_lock_irqsave(&d->arch.irq_lock, flags);
   2.102      ret = unmap_domain_pirq(d, unmap->pirq);
   2.103      spin_unlock_irqrestore(&d->arch.irq_lock, flags);
   2.104 +
   2.105      rcu_unlock_domain(d);
   2.106  
   2.107      return ret;
   2.108 @@ -452,14 +437,9 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
   2.109  
   2.110          irq_op.vector = assign_irq_vector(irq);
   2.111  
   2.112 -        ret = 0;
   2.113 -
   2.114 -        if ( msi_enable )
   2.115 -        {
   2.116 -            spin_lock_irqsave(&dom0->arch.irq_lock, flags);
   2.117 -            ret = map_domain_pirq(dom0, irq_op.irq, irq_op.vector, NULL);
   2.118 -            spin_unlock_irqrestore(&dom0->arch.irq_lock, flags);
   2.119 -        }
   2.120 +        spin_lock_irqsave(&dom0->arch.irq_lock, flags);
   2.121 +        ret = map_domain_pirq(dom0, irq_op.irq, irq_op.vector, NULL);
   2.122 +        spin_unlock_irqrestore(&dom0->arch.irq_lock, flags);
   2.123  
   2.124          if ( copy_to_guest(arg, &irq_op, 1) != 0 )
   2.125              ret = -EFAULT;
     3.1 --- a/xen/include/asm-x86/io_apic.h	Tue Sep 09 17:28:05 2008 +0100
     3.2 +++ b/xen/include/asm-x86/io_apic.h	Wed Sep 10 10:47:46 2008 +0100
     3.3 @@ -162,8 +162,6 @@ static inline void io_apic_modify(unsign
     3.4  /* 1 if "noapic" boot option passed */
     3.5  extern int skip_ioapic_setup;
     3.6  
     3.7 -extern int msi_enable;
     3.8 -
     3.9  /*
    3.10   * If we use the IO-APIC for IRQ routing, disable automatic
    3.11   * assignment of PCI IRQ's.