aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/event_channel.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-08-31 15:23:12 +0100
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-08-31 15:23:12 +0100
commit79858fee307c1b47eef66a0c280d23b650e8d906 (patch)
treebb314b7b18c3af053053287003363778d3ee4c88 /xen/common/event_channel.c
parent12b6ea528fd6048bebcaee852d1b6be811907be3 (diff)
downloadxen-79858fee307c1b47eef66a0c280d23b650e8d906.tar.gz
xen-79858fee307c1b47eef66a0c280d23b650e8d906.tar.bz2
xen-79858fee307c1b47eef66a0c280d23b650e8d906.zip
xen: fix hvm_domain_use_pirq's behavior
hvm_domain_use_pirq should return true when the guest is using a certain pirq, no matter if the corresponding event channel is currently enabled or disabled. As an additional complication, qemu is going to request pirqs for passthrough devices even for Xen unaware HVM guests, so we need to wait for an event channel to be connected before considering the pirq of a passthrough device as "in use". Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'xen/common/event_channel.c')
-rw-r--r--xen/common/event_channel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 631bbede22..0628120c24 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -366,6 +366,9 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
bind->port = port;
+ if ( is_hvm_domain(d) && domain_pirq_to_irq(d, pirq) > 0 )
+ map_domain_emuirq_pirq(d, pirq, IRQ_PT);
+
out:
spin_unlock(&d->event_lock);
@@ -419,6 +422,8 @@ static long __evtchn_close(struct domain *d1, int port1)
pirq->evtchn = 0;
pirq_cleanup_check(pirq, d1);
unlink_pirq_port(chn1, d1->vcpu[chn1->notify_vcpu_id]);
+ if ( is_hvm_domain(d1) && domain_pirq_to_irq(d1, pirq->pirq) > 0 )
+ unmap_domain_pirq_emuirq(d1, pirq->pirq);
break;
}