ia64/xen-unstable

changeset 4640:3b8b51c4560c

bitkeeper revision 1.1370 (4269298fN8pBqkwEJEdXf9MR8bXVzA)

Add a headroom check to MMUEXT_REASSIGN_PAGE.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Apr 22 16:42:55 2005 +0000 (2005-04-22)
parents 31a334290f9c
children 793d5c557544
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Fri Apr 22 16:34:45 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Fri Apr 22 16:42:55 2005 +0000
     1.3 @@ -1686,11 +1686,19 @@ int do_mmuext_op(
     1.4                  spin_lock(&d->page_alloc_lock);
     1.5              }
     1.6              
     1.7 -            /* A domain shouldn't have PGC_allocated pages when it is dying. */
     1.8 +            /*
     1.9 +             * Check that 'e' will accept the page and has reservation
    1.10 +             * headroom. Also, a domain mustn't have PGC_allocated pages when
    1.11 +             * it is dying. 
    1.12 +             */
    1.13 +            ASSERT(e->tot_pages <= e->max_pages);
    1.14              if ( unlikely(test_bit(DF_DYING, &e->d_flags)) ||
    1.15 +                 unlikely(e->tot_pages == e->max_pages) ||
    1.16                   unlikely(IS_XEN_HEAP_FRAME(page)) )
    1.17              {
    1.18 -                MEM_LOG("Reassign page is Xen heap, or dest dom is dying.");
    1.19 +                MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
    1.20 +                        "page is in Xen heap (%p), or dom is dying (%d).\n",
    1.21 +                        e->tot_pages, e->max_pages, op.mfn, e->d_flags);
    1.22                  okay = 0;
    1.23                  goto reassign_fail;
    1.24              }