d->arch.paging.hap.total_pages--;
d->arch.paging.hap.p2m_pages++;
page_set_owner(pg, d);
- pg->count_info = 1;
+ pg->count_info |= 1;
}
hap_unlock(d);
if ( (pg->count_info & PGC_count_mask) != 1 )
HAP_ERROR("Odd p2m page count c=%#lx t=%"PRtype_info"\n",
pg->count_info, pg->u.inuse.type_info);
- pg->count_info = 0;
+ pg->count_info &= ~PGC_count_mask;
/* Free should not decrement domain's total allocation, since
* these pages were allocated without an owner. */
page_set_owner(pg, NULL);
ASSERT(pg);
d->arch.paging.hap.free_pages--;
d->arch.paging.hap.total_pages--;
- pg->count_info = 0;
free_domheap_page(pg);
}
return 0;
page_list_add_tail(pg, &d->arch.p2m->pages);
pg->u.inuse.type_info = type | 1 | PGT_validated;
- pg->count_info = 1;
+ pg->count_info |= 1;
new_entry = l1e_from_pfn(mfn_x(page_to_mfn(pg)),
__PAGE_HYPERVISOR|_PAGE_USER);
return 0;
page_list_add_tail(pg, &d->arch.p2m->pages);
pg->u.inuse.type_info = PGT_l1_page_table | 1 | PGT_validated;
- pg->count_info = 1;
+ pg->count_info |= 1;
/* New splintered mappings inherit the flags of the old superpage,
* with a little reorganisation for the _PAGE_PSE_PAT bit. */
* believed to be a concern.
*/
page_set_owner(&pg[i], d);
- pg[i].count_info = 1;
+ pg[i].count_info |= 1;
page_list_add_tail(&pg[i], &d->arch.paging.shadow.p2m_freelist);
}
return 1;
SHADOW_ERROR("Odd p2m page count c=%#lx t=%"PRtype_info"\n",
pg->count_info, pg->u.inuse.type_info);
}
- pg->count_info = 0;
+ pg->count_info &= ~PGC_count_mask;
/* Free should not decrement domain's total allocation, since
* these pages were allocated without an owner. */
page_set_owner(pg, NULL);
while ( sp )
{
/* Not a shadow? */
- BUG_ON( sp->count_info != 0 );
+ BUG_ON( (sp->count_info & PGC_count_mask )!= 0 ) ;
/* Bogus type? */
BUG_ON( sp->u.sh.type == 0 );
BUG_ON( sp->u.sh.type > SH_type_max_shadow );
sp = mfn_to_page(smfn);
- if ( sp->count_info != 0
+ if ( ((sp->count_info & PGC_count_mask) != 0)
|| (sp->u.sh.type != SH_type_l1_shadow
&& sp->u.sh.type != SH_type_fl1_shadow) )
goto fail;
struct page_info *sp = mfn_to_page(smfn);
ASSERT(mfn_valid(smfn));
- ASSERT(sp->count_info == 0);
+ ASSERT(!(sp->count_info & PGC_count_mask));
/* If this is the entry in the up-pointer, remove it */
if ( entry_pa != 0