]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86/mm: Make sure the event channel is released accurately
authorKaixing Hong <hongkaixing@huawei.com>
Fri, 17 Feb 2012 07:14:25 +0000 (15:14 +0800)
committerKaixing Hong <hongkaixing@huawei.com>
Fri, 17 Feb 2012 07:14:25 +0000 (15:14 +0800)
    In xenpaging source code,there is an interdomain communication between dom0
and domU. In mem_event_enable(),the function alloc_unbound_xen_event_channel()
allocates a free port for domU, and then it will be bound with dom0.
When xenpaging tears down,it just frees dom0's event channel port by
xc_evtchn_unbind(), leaves domU's port still occupied.
    So we add the patch to free domU's port when xenpaging exits.
We need double free interdomain eventchannel. First free domainU port,
and leave domain 0 port unbond, Then free domain 0 port.

Signed-off-by: Kaixing Hong <hongkaixing@huawei.com>,
Signed-off-by: Zhen Shi <bicky.shi@huawei.com>
Acked-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/mem_event.c

index 3b2267adfbeb1e655f1331e12189f0a0b6fe2d0d..35bfedd8325a966f144f4732d60a105776ae13de 100644 (file)
@@ -243,6 +243,9 @@ static int mem_event_disable(struct domain *d, struct mem_event_domain *med)
             return -EBUSY;
         }
 
+        /* Free domU's event channel and leave the other one unbound */
+        free_xen_event_channel(d->vcpu[0], med->xen_port);
+        
         unmap_domain_page(med->ring_page);
         med->ring_page = NULL;