{
struct domain *d = v->domain;
p2m_type_t p2mt;
- gfn_to_mfn(d, paddr_to_pfn(gpaddr), &p2mt);
+ gfn_to_mfn_query(d, paddr_to_pfn(gpaddr), &p2mt);
if (p2m_is_ram(p2mt))
gdprintk(XENLOG_WARNING,
"Conflict occurs for a given guest l1e flags:%x "
if ( 0 == rc )
gdprintk(XENLOG_ERR,
"set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
- mfn_x(gfn_to_mfn(d, gfn, &ot)));
+ mfn_x(gfn_to_mfn_query(d, gfn, &ot)));
return rc;
}
p2m_unlock(p2m);
if ( 0 == rc )
gdprintk(XENLOG_ERR,
- "set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
- gmfn_to_mfn(p2m->domain, gfn));
+ "set_shared_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
+ mfn_x(gfn_to_mfn_query(d, gfn, &ot)));
return rc;
}
/* Iterate over VRAM to track dirty bits. */
for ( i = 0; i < nr; i++ ) {
- mfn_t mfn = gfn_to_mfn(d, begin_pfn + i, &t);
+ mfn_t mfn = gfn_to_mfn_query(d, begin_pfn + i, &t);
struct page_info *page;
int dirty = 0;
paddr_t sl1ma = dirty_vram->sl1ma[i];
/* was clean for more than two seconds, try to disable guest
* write access */
for ( i = begin_pfn; i < end_pfn; i++ ) {
- mfn_t mfn = gfn_to_mfn(d, i, &t);
+ mfn_t mfn = gfn_to_mfn_query(d, i, &t);
if (mfn_x(mfn) != INVALID_MFN)
flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
}
return gfn_to_mfn_type_p2m(p2m, gfn, t, &a, q);
}
+/* Syntactic sugar: most callers will use one of these.
+ * N.B. gfn_to_mfn_query() is the _only_ one guaranteed not to take the
+ * p2m lock; none of the others can be called with the p2m, hap or
+ * shadow lock held. */
#define gfn_to_mfn(d, g, t) gfn_to_mfn_type((d), (g), (t), p2m_alloc)
#define gfn_to_mfn_query(d, g, t) gfn_to_mfn_type((d), (g), (t), p2m_query)
#define gfn_to_mfn_guest(d, g, t) gfn_to_mfn_type((d), (g), (t), p2m_guest)