aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/irq.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-09-18 00:26:52 +0100
committerJan Beulich <jbeulich@suse.com>2011-09-18 00:26:52 +0100
commit1b0061ac2b57297e7d7211ce6f4e1b197b8e0ec2 (patch)
tree4bb3b14eb7af3223ce36a09fbf9de90776aa3919 /xen/arch/x86/irq.c
parentac4afd4aaac5f8e6e706f97bbfb0bd925577ed15 (diff)
downloadxen-1b0061ac2b57297e7d7211ce6f4e1b197b8e0ec2.tar.gz
xen-1b0061ac2b57297e7d7211ce6f4e1b197b8e0ec2.tar.bz2
xen-1b0061ac2b57297e7d7211ce6f4e1b197b8e0ec2.zip
x86: split MSI IRQ chip
With the .end() accessor having become optional and noting that several of the accessors' behavior really depends on the result of msi_maskable_irq(), the splits the MSI IRQ chip type into two - one for the maskable ones, and the other for the (MSI only) non-maskable ones. At once the implementation of those methods gets moved from io_apic.c to msi.c. Signed-off-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/irq.c')
-rw-r--r--xen/arch/x86/irq.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 71ea764868..9606ae2c1e 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1304,7 +1304,7 @@ static int pirq_acktype(struct domain *d, int pirq)
* MSIs are treated as edge-triggered interrupts, except
* when there is no proper way to mask them.
*/
- if ( desc->handler == &pci_msi_type )
+ if ( desc->msi_desc )
return msi_maskable_irq(desc->msi_desc) ? ACKTYPE_NONE : ACKTYPE_EOI;
/*
@@ -1723,7 +1723,7 @@ int map_domain_pirq(
if ( desc->handler != &no_irq_type )
dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
d->domain_id, irq);
- desc->handler = &pci_msi_type;
+ setup_msi_handler(desc, msi_desc);
if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
&& !desc->chip_data->used_vectors )
@@ -1739,7 +1739,7 @@ int map_domain_pirq(
}
set_domain_irq_pirq(d, irq, info);
- setup_msi_irq(msi_desc, irq);
+ setup_msi_irq(desc);
spin_unlock_irqrestore(&desc->lock, flags);
}
else
@@ -1807,6 +1807,12 @@ int unmap_domain_pirq(struct domain *d, int pirq)
radix_tree_int_to_ptr(-pirq));
}
+ if ( msi_desc )
+ {
+ desc->handler = &no_irq_type;
+ desc->msi_desc = NULL;
+ }
+
spin_unlock_irqrestore(&desc->lock, flags);
if (msi_desc)
msi_free_irq(msi_desc);
@@ -1819,9 +1825,6 @@ int unmap_domain_pirq(struct domain *d, int pirq)
dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
d->domain_id, pirq);
- if ( desc->handler == &pci_msi_type )
- desc->handler = &no_irq_type;
-
done:
return ret;
}