[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86/mm: don't override an existing shadow memory allocation when
# HG changeset patch # User Keir Fraser <keir@xxxxxxx> # Date 1290172848 0 # Node ID ff989ac7cd970598f64a05a07b037f1423f7cb47 # Parent 7d2fdc083c9c27142f09177e5f021e390da1550f x86/mm: don't override an existing shadow memory allocation when enabling log-dirty shadows on a PV guest. Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx> --- xen/arch/x86/mm/shadow/common.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff -r 7d2fdc083c9c -r ff989ac7cd97 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Thu Nov 18 12:28:31 2010 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Fri Nov 19 13:20:48 2010 +0000 @@ -3311,15 +3311,21 @@ static int shadow_one_bit_enable(struct mode |= PG_SH_enable; - if ( d->arch.paging.mode == 0 ) - { - /* Init the shadow memory allocation and the hash table */ - if ( sh_set_allocation(d, 1, NULL) != 0 - || shadow_hash_alloc(d) != 0 ) + if ( d->arch.paging.shadow.total_pages == 0 ) + { + /* Init the shadow memory allocation if the user hasn't done so */ + if ( sh_set_allocation(d, 1, NULL) != 0 ) { sh_set_allocation(d, 0, NULL); return -ENOMEM; } + } + + if ( d->arch.paging.mode == 0 ) + { + /* Init the shadow hash table */ + if ( shadow_hash_alloc(d) != 0 ) + return -ENOMEM; } /* Update the bits */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |