From 6a727d6be892ea5ff818446d96974bebdf8ac3a2 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 15 Apr 2013 10:33:48 +0200 Subject: 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 Acked-by: "Zhang, Xiantao" --- xen/arch/x86/irq.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xen/arch/x86/irq.c') 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 -- cgit v1.2.3