diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-04-15 10:33:48 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-04-15 10:33:48 +0200 |
commit | 6a727d6be892ea5ff818446d96974bebdf8ac3a2 (patch) | |
tree | 7b167dd6266b4c5b4824a496c8e7405fba05f489 /xen/arch/x86/irq.c | |
parent | 887885c17ada9c571a7a2cd71410876448d0610a (diff) | |
download | xen-6a727d6be892ea5ff818446d96974bebdf8ac3a2.tar.gz xen-6a727d6be892ea5ff818446d96974bebdf8ac3a2.tar.bz2 xen-6a727d6be892ea5ff818446d96974bebdf8ac3a2.zip |
IOMMU: allow MSI message to IRTE propagation to fail
With the need to allocate multiple contiguous IRTEs for multi-vector
MSI, the chance of failure here increases. While on the AMD side
there's no allocation of IRTEs at present at all (and hence no way for
this allocation to fail, which is going to change with a later patch in
this series), VT-d already ignores an eventual error here, which this
patch fixes.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Diffstat (limited to 'xen/arch/x86/irq.c')
-rw-r--r-- | xen/arch/x86/irq.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index dffb33a231..fa6b9a2e31 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1938,7 +1938,14 @@ 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); - setup_msi_handler(desc, msi_desc); + + ret = setup_msi_irq(desc, msi_desc); + if ( ret ) + { + spin_unlock_irqrestore(&desc->lock, flags); + pci_disable_msi(msi_desc); + goto done; + } if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV && !desc->arch.used_vectors ) @@ -1954,7 +1961,6 @@ int map_domain_pirq( } set_domain_irq_pirq(d, irq, info); - setup_msi_irq(desc); spin_unlock_irqrestore(&desc->lock, flags); } else |