ia64/xen-unstable

changeset 2770:7f8159c0f9dc

bitkeeper revision 1.1159.140.2 (4181ffecq3PQVDZfRw16mEwphHTvbw)

Added comments to document the not-so-obvious reference count
sleight-of-hand in construct_dom0().
author mafetter@fleming.research
date Fri Oct 29 08:31:40 2004 +0000 (2004-10-29)
parents 7765521a561d
children 1b906236acc9
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Oct 29 08:28:20 2004 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Fri Oct 29 08:31:40 2004 +0000
     1.3 @@ -770,7 +770,14 @@ int construct_dom0(struct domain *p,
     1.4          {
     1.5              page->u.inuse.type_info &= ~PGT_type_mask;
     1.6              page->u.inuse.type_info |= PGT_l2_page_table;
     1.7 +
     1.8 +            /*
     1.9 +             * No longer writable: decrement the type_count.
    1.10 +             * Installed as CR3: increment both the ref_count and type_count.
    1.11 +             * Net: just increment the ref_count.
    1.12 +             */
    1.13              get_page(page, p); /* an extra ref because of readable mapping */
    1.14 +
    1.15              /* Get another ref to L2 page so that it can be pinned. */
    1.16              if ( !get_page_and_type(page, p, PGT_l2_page_table) )
    1.17                  BUG();
    1.18 @@ -783,6 +790,12 @@ int construct_dom0(struct domain *p,
    1.19  	    page->u.inuse.type_info |= 
    1.20  		((dsi.v_start>>L2_PAGETABLE_SHIFT)+(count-1))<<PGT_va_shift;
    1.21  
    1.22 +            /*
    1.23 +             * No longer writable: decrement the type_count.
    1.24 +             * This is an L1 page, installed in a validated L2 page:
    1.25 +             * increment both the ref_count and type_count.
    1.26 +             * Net: just increment the ref_count.
    1.27 +             */
    1.28              get_page(page, p); /* an extra ref because of readable mapping */
    1.29          }
    1.30          l1tab++;