aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-01-31 11:39:37 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-01-31 11:39:37 +0000
commitf17888fc962b5249f9b6b34f28a61998c3092018 (patch)
tree70ae2f49efef614ba82a3fa4e03ab09d8ba883cb
parentc9929dfe104deb98f5f5213c2cefba40c2dd6d47 (diff)
downloadxen-f17888fc962b5249f9b6b34f28a61998c3092018.tar.gz
xen-f17888fc962b5249f9b6b34f28a61998c3092018.tar.bz2
xen-f17888fc962b5249f9b6b34f28a61998c3092018.zip
xen: do not remap pirqs if !is_hvm_pv_evtchn_domain
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>
-rw-r--r--xen/arch/x86/physdev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index df92cc7fdc..a3ceb7d84f 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -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;
}