return 1;
}
-void oos_fixup_add(struct vcpu *v, mfn_t gmfn,
+void oos_fixup_add(struct domain *d, mfn_t gmfn,
mfn_t smfn, unsigned long off)
{
int idx, next;
mfn_t *oos;
struct oos_fixup *oos_fixup;
- struct domain *d = v->domain;
+ struct vcpu *v;
perfc_incr(shadow_oos_fixup_add);
}
/* Remove an MFN from the list of out-of-sync guest pagetables */
-static void oos_hash_remove(struct vcpu *v, mfn_t gmfn)
+static void oos_hash_remove(struct domain *d, mfn_t gmfn)
{
int idx;
mfn_t *oos;
- struct domain *d = v->domain;
+ struct vcpu *v;
- SHADOW_PRINTK("%pv gmfn %lx\n", v, mfn_x(gmfn));
+ SHADOW_PRINTK("d%d gmfn %lx\n", d->domain_id, mfn_x(gmfn));
for_each_vcpu(d, v)
{
BUG();
}
-mfn_t oos_snapshot_lookup(struct vcpu *v, mfn_t gmfn)
+mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn)
{
int idx;
mfn_t *oos;
mfn_t *oos_snapshot;
- struct domain *d = v->domain;
+ struct vcpu *v;
for_each_vcpu(d, v)
{
}
/* Pull a single guest page back into sync */
-void sh_resync(struct vcpu *v, mfn_t gmfn)
+void sh_resync(struct domain *d, mfn_t gmfn)
{
int idx;
mfn_t *oos;
mfn_t *oos_snapshot;
struct oos_fixup *oos_fixup;
- struct domain *d = v->domain;
+ struct vcpu *v;
for_each_vcpu(d, v)
{
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
/* Is the page already shadowed and out of sync? */
if ( page_is_out_of_sync(page) )
- sh_resync(v, gmfn);
+ sh_resync(d, gmfn);
#endif
/* We should never try to promote a gmfn that has writeable mappings */
void shadow_demote(struct vcpu *v, mfn_t gmfn, u32 type)
{
+ struct domain *d = v->domain;
struct page_info *page = mfn_to_page(gmfn);
ASSERT(test_bit(_PGC_page_table, &page->count_info));
/* Was the page out of sync? */
if ( page_is_out_of_sync(page) )
{
- oos_hash_remove(v, gmfn);
+ oos_hash_remove(d, gmfn);
}
#endif
clear_bit(_PGC_page_table, &page->count_info);
static inline uint32_t
gw_remove_write_accesses(struct vcpu *v, unsigned long va, walk_t *gw)
{
+#if GUEST_PAGING_LEVELS >= 3 /* PAE or 64... */
+#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
+ struct domain *d = v->domain;
+#endif
+#endif
uint32_t rc = 0;
#if GUEST_PAGING_LEVELS >= 3 /* PAE or 64... */
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
if ( mfn_is_out_of_sync(gw->l3mfn) )
{
- sh_resync(v, gw->l3mfn);
+ sh_resync(d, gw->l3mfn);
rc = GW_RMWR_REWALK;
}
else
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
if ( mfn_is_out_of_sync(gw->l2mfn) )
{
- sh_resync(v, gw->l2mfn);
+ sh_resync(d, gw->l2mfn);
rc |= GW_RMWR_REWALK;
}
else
OOS. */
if ( (sp->u.sh.type != SH_type_fl1_shadow) && mfn_valid(gl1mfn)
&& mfn_is_out_of_sync(gl1mfn) )
- sh_resync(v, gl1mfn);
+ sh_resync(d, gl1mfn);
}
#endif
#if GUEST_PAGING_LEVELS == 2
if ( mfn_valid(new_gmfn) && mfn_oos_may_write(new_gmfn)
&& ((shadow_l1e_get_flags(new_sl1e) & (_PAGE_RW|_PAGE_PRESENT))
== (_PAGE_RW|_PAGE_PRESENT)) )
- oos_fixup_add(v, new_gmfn, sl1mfn, pgentry_ptr_to_slot(sl1e));
+ oos_fixup_add(d, new_gmfn, sl1mfn, pgentry_ptr_to_slot(sl1e));
#endif
old_sl1e = *sl1e;
&& mfn_is_out_of_sync(gl1mfn) )
{
/* Update the OOS snapshot. */
- mfn_t snpmfn = oos_snapshot_lookup(v, gl1mfn);
+ mfn_t snpmfn = oos_snapshot_lookup(d, gl1mfn);
guest_l1e_t *snp;
ASSERT(mfn_valid(snpmfn));
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
if ( mfn_is_out_of_sync(gw->l1mfn) )
{
- mfn_t snpmfn = oos_snapshot_lookup(v, gw->l1mfn);
+ mfn_t snpmfn = oos_snapshot_lookup(d, gw->l1mfn);
ASSERT(mfn_valid(snpmfn));
snpl1p = sh_map_domain_page(snpmfn);
&& mfn_is_out_of_sync(gw.l1mfn) )
{
/* Update the OOS snapshot. */
- mfn_t snpmfn = oos_snapshot_lookup(v, gw.l1mfn);
+ mfn_t snpmfn = oos_snapshot_lookup(d, gw.l1mfn);
guest_l1e_t *snp;
ASSERT(mfn_valid(snpmfn));
int sh_unsync(struct vcpu *v, mfn_t gmfn);
/* Pull an out-of-sync page back into sync. */
-void sh_resync(struct vcpu *v, mfn_t gmfn);
+void sh_resync(struct domain *d, mfn_t gmfn);
-void oos_fixup_add(struct vcpu *v, mfn_t gmfn, mfn_t smfn, unsigned long off);
+void oos_fixup_add(struct domain *d, mfn_t gmfn, mfn_t smfn, unsigned long off);
int sh_remove_write_access_from_sl1p(struct vcpu *v, mfn_t gmfn,
mfn_t smfn, unsigned long offset);
}
void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn);
-mfn_t oos_snapshot_lookup(struct vcpu *v, mfn_t gmfn);
+mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn);
#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */