return violation;
}
-#ifdef CONFIG_HVM
bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
struct npfec npfec,
vm_event_request_t **req_ptr)
*/
return ap2m->set_entry(ap2m, gfn, mfn, PAGE_ORDER_4K, t, a, -1);
}
-#endif
static int set_mem_access(struct domain *d, struct p2m_domain *p2m,
struct p2m_domain *ap2m, p2m_access_t a,
{
int rc = 0;
-#ifdef CONFIG_HVM
if ( ap2m )
{
rc = p2m_set_altp2m_mem_access(d, p2m, ap2m, a, gfn);
rc = 0;
}
else
-#else
- ASSERT(!ap2m);
-#endif
{
p2m_access_t _a;
p2m_type_t t;
long rc = 0;
/* altp2m view 0 is treated as the hostp2m */
-#ifdef CONFIG_HVM
if ( altp2m_idx )
{
if ( altp2m_idx >= min(ARRAY_SIZE(d->arch.altp2m_p2m), MAX_EPTP) ||
ap2m = array_access_nospec(d->arch.altp2m_p2m, altp2m_idx);
}
-#else
- ASSERT(!altp2m_idx);
-#endif
if ( !xenmem_access_to_p2m_access(p2m, access, &a) )
return -EINVAL;
long rc = 0;
/* altp2m view 0 is treated as the hostp2m */
-#ifdef CONFIG_HVM
if ( altp2m_idx )
{
if ( altp2m_idx >= min(ARRAY_SIZE(d->arch.altp2m_p2m), MAX_EPTP) ||
ap2m = array_access_nospec(d->arch.altp2m_p2m, altp2m_idx);
}
-#else
- ASSERT(!altp2m_idx);
-#endif
p2m_lock(p2m);
if ( ap2m )
{
struct p2m_domain *p2m = p2m_get_hostp2m(d);
-#ifdef CONFIG_HVM
if ( !altp2m_active(d) )
{
if ( altp2m_idx )
p2m = array_access_nospec(d->arch.altp2m_p2m, altp2m_idx);
}
-#else
- ASSERT(!altp2m_idx);
-#endif
return _p2m_get_mem_access(p2m, gfn, access);
}
p2m_get_hostp2m(d)->access_required = access_required;
-#ifdef CONFIG_HVM
if ( altp2m_active(d) )
{
unsigned int i;
p2m->access_required = access_required;
}
}
-#endif
}
bool p2m_mem_access_sanity_check(const struct domain *d)