hongkaixing@huawei.com
2012-Feb-17 07:15 UTC
[PATCH] x86/mm: Make sure the event channel is released accurately
# HG changeset patch
# User h00166998@h00166998.china.huawei.com
# Date 1329462865 -28800
# Node ID 9fd12f919ddbd15927117eff42149664dba698ca
# Parent b75664e5390583c5d2075c82a14245bc941b3aaf
x86/mm: Make sure the event channel is released accurately
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-byKaixing Hong <hongkaixing@huawei.com>,
Signed-off-byZhen Shi <bicky.shi@huawei.com>
diff -r b75664e53905 -r 9fd12f919ddb xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c Thu Feb 16 15:43:02 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c Fri Feb 17 15:14:25 2012 +0800
@@ -243,6 +243,9 @@
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;
--===============7093614109929523318=Content-Type: text/plain;
charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
--===============7093614109929523318==--
Olaf Hering
2012-Feb-17 07:38 UTC
Re: [PATCH] x86/mm: Make sure the event channel is released accurately
On Fri, Feb 17, hongkaixing@huawei.com wrote:> 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>
Apparently Analagous Threads
- [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in
- [PATCH] xenpaging:add a new array to speed up page-in in xenpaging
- [PATCH] [resend] xen-access: Check return values and clean up on errors during init
- [PATCH 0 of 2] xenpaging:speed up page-in
- [PATCH 0 of 2] v2: memshare/xenpaging/xen-access fixes for xen-unstable