debuggers.hg

changeset 20854:db8a882f5515

Make sure the minimum shadow allocation is never zero.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 14 14:11:25 2010 +0000 (2010-01-14)
parents 4b8843ecd553
children 88d2273c3942
files xen/arch/x86/mm/shadow/common.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Thu Jan 14 14:10:40 2010 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Thu Jan 14 14:11:25 2010 +0000
     1.3 @@ -1244,10 +1244,11 @@ int shadow_cmpxchg_guest_entry(struct vc
     1.4   * instruction, we must be able to map a large number (about thirty) VAs
     1.5   * at the same time, which means that to guarantee progress, we must
     1.6   * allow for more than ninety allocated pages per vcpu.  We round that
     1.7 - * up to 128 pages, or half a megabyte per vcpu. */
     1.8 + * up to 128 pages, or half a megabyte per vcpu, and add 1 more vcpu's 
     1.9 + * worth to make sure we never return zero. */
    1.10  static unsigned int shadow_min_acceptable_pages(struct domain *d) 
    1.11  {
    1.12 -    u32 vcpu_count = 0;
    1.13 +    u32 vcpu_count = 1;
    1.14      struct vcpu *v;
    1.15  
    1.16      for_each_vcpu(d, v)