diff options
author | Tim Deegan <tim@xen.org> | 2012-03-07 08:54:24 +0000 |
---|---|---|
committer | Tim Deegan <tim@xen.org> | 2012-03-07 08:54:24 +0000 |
commit | a1c5825cbb732a4b2af183007cce1ca99019174b (patch) | |
tree | 014d998065c0142d2d6448f7d32d982359f4eb24 | |
parent | 12b6d9e556580c93f0026ce620e282f1cddb3674 (diff) | |
download | xen-a1c5825cbb732a4b2af183007cce1ca99019174b.tar.gz xen-a1c5825cbb732a4b2af183007cce1ca99019174b.tar.bz2 xen-a1c5825cbb732a4b2af183007cce1ca99019174b.zip |
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
-rw-r--r-- | xen/arch/x86/mm/paging.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index a126fa8c0f..b11577a204 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -621,7 +621,6 @@ void paging_log_dirty_init(struct domain *d, d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty; d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty; d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap; - d->arch.paging.log_dirty.top = _mfn(INVALID_MFN); } /* This function fress log dirty bitmap resources. */ @@ -642,6 +641,11 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags) if ( (rc = p2m_init(d)) != 0 ) return rc; + /* This must be initialized separately from the rest of the + * log-dirty init code as that can be called more than once and we + * don't want to leak any active log-dirty bitmaps */ + d->arch.paging.log_dirty.top = _mfn(INVALID_MFN); + /* The order of the *_init calls below is important, as the later * ones may rewrite some common fields. Shadow pagetables are the * default... */ |