# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1154057753 -32400 # Node ID 145cb880220fd29b37d114b4e0913c699c99fe0e # Parent 9ebb2c82bec9031149c3643eef8df0d118596dcf fix memory leak when VT-i domain is created. When domain is created, xend sets max vcpu before domain setup. So alloc_vcpu_struct() think the domain is normal domU, not domVTI. And next xend set the domain as domVTI. so the memory is allocated for domU won't be freed. PATCHNAME: dom_vti_memory_leak Signed-off-by: Isaku Yamahata diff -r 9ebb2c82bec9 -r 145cb880220f xen/arch/ia64/xen/dom0_ops.c --- a/xen/arch/ia64/xen/dom0_ops.c Thu Jul 27 20:53:36 2006 +0900 +++ b/xen/arch/ia64/xen/dom0_ops.c Fri Jul 28 12:35:53 2006 +0900 @@ -20,6 +20,7 @@ #include #include #include +#include void build_physmap_table(struct domain *d); @@ -244,6 +245,15 @@ long arch_do_dom0_op(dom0_op_t *op, XEN_ ret = -EINVAL; break; } + if (!d->arch.is_vti) { + struct vcpu *v; + for_each_vcpu(d, v) { + BUG_ON(v->arch.privregs == NULL); + free_xenheap_pages(v->arch.privregs, + get_order_from_shift(XMAPPEDREGS_SHIFT)); + v->arch.privregs = NULL; + } + } d->arch.is_vti = 1; vmx_setup_platform(d); }