if ( !cr3_page )
rc = -EINVAL;
- else if ( paging_mode_refcounts(d) )
- /* nothing */;
else if ( cr3_page == v->arch.old_guest_table )
{
v->arch.old_guest_table = NULL;
case -ERESTART:
break;
case 0:
- if ( !compat && !VM_ASSIST(d, m2p_strict) &&
- !paging_mode_refcounts(d) )
+ if ( !compat && !VM_ASSIST(d, m2p_strict) )
fill_ro_mpt(cr3_mfn);
break;
default:
if ( !cr3_page )
rc = -EINVAL;
- else if ( !paging_mode_refcounts(d) )
+ else
{
rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
switch ( rc )
return rc;
}
+#ifdef CONFIG_PV
int new_guest_cr3(mfn_t mfn)
{
-#ifdef CONFIG_PV
struct vcpu *curr = current;
struct domain *d = curr->domain;
int rc;
pv_destroy_ldt(curr); /* Unconditional TLB flush later. */
- if ( !VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d) )
+ if ( !VM_ASSIST(d, m2p_strict) )
fill_ro_mpt(mfn);
curr->arch.guest_table = pagetable_from_mfn(mfn);
update_cr3(curr);
{
struct page_info *page = mfn_to_page(old_base_mfn);
- if ( paging_mode_refcounts(d) )
- put_page(page);
- else
- switch ( rc = put_page_and_type_preemptible(page) )
- {
- case -EINTR:
- case -ERESTART:
- curr->arch.old_guest_ptpg = NULL;
- curr->arch.old_guest_table = page;
- curr->arch.old_guest_table_partial = (rc == -ERESTART);
- rc = -ERESTART;
- break;
- default:
- BUG_ON(rc);
- break;
- }
+ switch ( rc = put_page_and_type_preemptible(page) )
+ {
+ case -EINTR:
+ case -ERESTART:
+ curr->arch.old_guest_ptpg = NULL;
+ curr->arch.old_guest_table = page;
+ curr->arch.old_guest_table_partial = (rc == -ERESTART);
+ rc = -ERESTART;
+ break;
+ default:
+ BUG_ON(rc);
+ break;
+ }
}
return rc;
-#else
- ASSERT_UNREACHABLE();
- return -EINVAL;
-#endif
}
+#endif
#ifdef CONFIG_PV
static int vcpumask_to_pcpumask(