for ( i = 0; i < (1UL << page_order); i++ )
{
p2m->get_entry(p2m, gfn_add(gfn, i), &t, &a, 0, NULL, NULL);
- if ( !p2m_is_grant(t) && !p2m_is_shared(t) && !p2m_is_foreign(t) )
+ if ( !p2m_is_special(t) && !p2m_is_shared(t) )
set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
}
}
&ot, &a, 0, NULL, NULL);
ASSERT(!p2m_is_shared(ot));
}
- if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
+ if ( p2m_is_special(ot) )
{
- /* Really shouldn't be unmapping grant/foreign maps this way */
+ /* Don't permit unmapping grant/foreign this way. */
domain_crash(d);
p2m_unlock(p2m);
- return -EINVAL;
+ return -EPERM;
}
else if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
{
struct p2m_domain *p2m = p2m_get_hostp2m(d);
int rc;
- BUG_ON(p2m_is_grant(ot) || p2m_is_grant(nt));
- BUG_ON(p2m_is_foreign(ot) || p2m_is_foreign(nt));
+ BUG_ON(p2m_is_special(ot) || p2m_is_special(nt));
gfn_lock(p2m, gfn, 0);
gfn_unlock(p2m, gfn, order);
return cur_order + 1;
}
- if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
+ if ( p2m_is_special(ot) )
{
gfn_unlock(p2m, gfn, order);
domain_crash(d);
- return -ENOENT;
+ return -EPERM;
}
else if ( p2m_is_ram(ot) )
{
| p2m_to_mask(p2m_ram_logdirty) )
#define P2M_SHARED_TYPES (p2m_to_mask(p2m_ram_shared))
+/* Types established/cleaned up via special accessors. */
+#define P2M_SPECIAL_TYPES (P2M_GRANT_TYPES | \
+ p2m_to_mask(p2m_map_foreign))
+
/* Valid types not necessarily associated with a (valid) MFN. */
#define P2M_INVALID_MFN_TYPES (P2M_POD_TYPES \
| p2m_to_mask(p2m_mmio_direct) \
#define p2m_is_paged(_t) (p2m_to_mask(_t) & P2M_PAGED_TYPES)
#define p2m_is_sharable(_t) (p2m_to_mask(_t) & P2M_SHARABLE_TYPES)
#define p2m_is_shared(_t) (p2m_to_mask(_t) & P2M_SHARED_TYPES)
+#define p2m_is_special(_t) (p2m_to_mask(_t) & P2M_SPECIAL_TYPES)
#define p2m_is_broken(_t) (p2m_to_mask(_t) & P2M_BROKEN_TYPES)
#define p2m_is_foreign(_t) (p2m_to_mask(_t) & p2m_to_mask(p2m_map_foreign))