From ddf4a60539588183547d2f9c72d8460df17d72bf Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 10 Sep 2008 10:47:46 +0100 Subject: x86: Remove MSI boot parameter -- now always on. Signed-off-by: Keir Fraser --- xen/arch/x86/io_apic.c | 13 ++------- xen/arch/x86/physdev.c | 62 +++++++++++++++---------------------------- xen/include/asm-x86/io_apic.h | 2 -- 3 files changed, 23 insertions(+), 54 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 643f61f669..bd197dccc3 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -45,23 +45,14 @@ 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 --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index 98eaf066b3..a6174dd46c 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -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 domain *d, int pirq) gdprintk(XENLOG_G_ERR, "domain %X: pirq %x not mapped still\n", d->domain_id, pirq); ret = -EINVAL; + goto done; } - 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); + desc = &irq_desc[vector]; + spin_lock_irqsave(&desc->lock, flags); + if ( desc->msi_desc ) + pci_disable_msi(vector); - d->arch.pirq_vector[pirq] = d->arch.vector_pirq[vector] = 0; + 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); - ret = irq_deny_access(d, pirq); + 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; } @@ -190,10 +187,6 @@ static int physdev_map_pirq(struct physdev_map_pirq *map) 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,29 +296,21 @@ static int physdev_unmap_pirq(struct physdev_unmap_pirq *unmap) 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); else 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_HANDLE(void) arg) 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 --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h index 0c3a14ce5b..59f8e0712e 100644 --- a/xen/include/asm-x86/io_apic.h +++ b/xen/include/asm-x86/io_apic.h @@ -162,8 +162,6 @@ static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned /* 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. -- cgit v1.2.3