Skip to contentSkip to conversation

x86/passthrough: don't leak guest IRQs

PATCH New Jan Beulich 1 participant 1 message Dec 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

xen/arch/x86/physdev.c +2 -1
@@ -219,7 +219,8 @@ int physdev_unmap_pirq(domid_t domid, in
     if ( is_hvm_domain(d) )
     {
         spin_lock(&d->event_lock);
-        ret = unmap_domain_pirq_emuirq(d, pirq);
+        if ( domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND )
+            ret = unmap_domain_pirq_emuirq(d, pirq);
         spin_unlock(&d->event_lock);
         if ( domid == DOMID_SELF || ret )
             goto free_domain;

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.

xen/arch/x86/physdev.c +2 -1
@@ -219,7 +219,8 @@ int physdev_unmap_pirq(domid_t domid, in
     if ( is_hvm_domain(d) )
     {
         spin_lock(&d->event_lock);
-        ret = unmap_domain_pirq_emuirq(d, pirq);
+        if ( domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND )
+            ret = unmap_domain_pirq_emuirq(d, pirq);
         spin_unlock(&d->event_lock);
         if ( domid == DOMID_SELF || ret )
             goto free_domain;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel