xcp-1.6-updates/xen-4.1.hg

changeset 23241:d21100f1d00e

x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must
not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset: 24448:3a22ed3ec534
xen-unstable date: Mon Jan 02 09:26:19 2012 +0100
author Jan Beulich <jbeulich@suse.com>
date Wed Mar 07 08:19:48 2012 +0000 (2012-03-07)
parents 0bea45ab39f7
children 96db1984e878
files xen/arch/x86/physdev.c
line diff
     1.1 --- a/xen/arch/x86/physdev.c	Wed Mar 07 08:17:44 2012 +0000
     1.2 +++ b/xen/arch/x86/physdev.c	Wed Mar 07 08:19:48 2012 +0000
     1.3 @@ -233,7 +233,8 @@ static int physdev_unmap_pirq(struct phy
     1.4      if ( is_hvm_domain(d) )
     1.5      {
     1.6          spin_lock(&d->event_lock);
     1.7 -        ret = unmap_domain_pirq_emuirq(d, unmap->pirq);
     1.8 +        if ( domain_pirq_to_emuirq(d, unmap->pirq) != IRQ_UNBOUND )
     1.9 +            ret = unmap_domain_pirq_emuirq(d, unmap->pirq);
    1.10          spin_unlock(&d->event_lock);
    1.11          if ( unmap->domid == DOMID_SELF || ret )
    1.12              goto free_domain;