mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1159.140.2 (4181ffecq3PQVDZfRw16mEwphHTvbw)
Added comments to document the not-so-obvious reference count sleight-of-hand in construct_dom0().
This commit is contained in:
1 parent
b7a3858071
commit
e32d4f83f0
1 file changed
+13
@@ -770,7 +770,14 @@ int construct_dom0(struct domain *p,
|
||||
{
|
||||
page->u.inuse.type_info &= ~PGT_type_mask;
|
||||
page->u.inuse.type_info |= PGT_l2_page_table;
|
||||
|
||||
/*
|
||||
* No longer writable: decrement the type_count.
|
||||
* Installed as CR3: increment both the ref_count and type_count.
|
||||
* Net: just increment the ref_count.
|
||||
*/
|
||||
get_page(page, p); /* an extra ref because of readable mapping */
|
||||
|
||||
/* Get another ref to L2 page so that it can be pinned. */
|
||||
if ( !get_page_and_type(page, p, PGT_l2_page_table) )
|
||||
BUG();
|
||||
@@ -783,6 +790,12 @@ int construct_dom0(struct domain *p,
|
||||
page->u.inuse.type_info |=
|
||||
((dsi.v_start>>L2_PAGETABLE_SHIFT)+(count-1))<<PGT_va_shift;
|
||||
|
||||
/*
|
||||
* No longer writable: decrement the type_count.
|
||||
* This is an L1 page, installed in a validated L2 page:
|
||||
* increment both the ref_count and type_count.
|
||||
* Net: just increment the ref_count.
|
||||
*/
|
||||
get_page(page, p); /* an extra ref because of readable mapping */
|
||||
}
|
||||
l1tab++;
|
||||
|
||||