xcp-1.6-updates/xen-4.1.hg

changeset 23237:a6bbda6dc322

x86/mm: Don't lose track of the log dirty bitmap

hap_log_dirty_init unconditionally sets the top of the log dirty
bitmap to INVALID_MFN. If there had been a bitmap allocated, it is
then leaked, and the host crashes on an ASSERT when the domain is
cleaned up.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 24282:a06cda9fb25f
xen-unstable date: Thu Dec 01 14:17:16 2011 +0000
author Tim Deegan <tim@xen.org>
date Wed Mar 07 08:13:47 2012 +0000 (2012-03-07)
parents ffda50fa20ab
children 95f48f40299f
files xen/arch/x86/mm/paging.c
line diff
     1.1 --- a/xen/arch/x86/mm/paging.c	Wed Mar 07 08:13:00 2012 +0000
     1.2 +++ b/xen/arch/x86/mm/paging.c	Wed Mar 07 08:13:47 2012 +0000
     1.3 @@ -665,7 +665,6 @@ void paging_log_dirty_init(struct domain
     1.4      d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty;
     1.5      d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty;
     1.6      d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
     1.7 -    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
     1.8  }
     1.9  
    1.10  /* This function fress log dirty bitmap resources. */
    1.11 @@ -686,6 +685,11 @@ int paging_domain_init(struct domain *d,
    1.12      if ( (rc = p2m_init(d)) != 0 )
    1.13          return rc;
    1.14  
    1.15 +    /* This must be initialized separately from the rest of the
    1.16 +     * log-dirty init code as that can be called more than once and we
    1.17 +     * don't want to leak any active log-dirty bitmaps */
    1.18 +    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
    1.19 +
    1.20      /* The order of the *_init calls below is important, as the later
    1.21       * ones may rewrite some common fields.  Shadow pagetables are the
    1.22       * default... */