xen: do not remap pirqs if !is_hvm_pv_evtchn_domain
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 31 Jan 2012 11:39:37 +0000 (11:39 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 31 Jan 2012 11:39:37 +0000 (11:39 +0000)
If the guest is an HVM guest and it is not using the vector callback
mechanism, refuse to remap pirqs onto event channels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Paulian Bogdan Marinca <paulian@marinca.net>
Committed-by: Keir Fraser <keir@xen.org>
xen/arch/x86/physdev.c

index df92cc7fdc440e03b135667f789024a3679a7b76..a3ceb7d84f69a203315f0148153ded4486759976 100644 (file)
@@ -93,6 +93,15 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
 
     if ( domid == DOMID_SELF && is_hvm_domain(d) )
     {
+        /*
+         * Only makes sense for vector-based callback, else HVM-IRQ logic
+         * calls back into itself and deadlocks on hvm_domain.irq_lock.
+         */
+        if ( !is_hvm_pv_evtchn_domain(d) )
+        {
+            ret = -EINVAL;
+            goto free_domain;
+        }
         ret = physdev_hvm_map_pirq(d, type, index, pirq_p);
         goto free_domain;
     }