return 0;
}
-static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
- p2m_type_t type, p2m_access_t access)
+static void ept_p2m_type_to_flags(const struct p2m_domain *p2m,
+ ept_entry_t *entry)
{
/*
* First apply type permissions.
* D bit is set for all writable types in EPT leaf entry, except for
* log-dirty type with PML.
*/
- switch(type)
+ switch ( entry->sa_p2mt )
{
case p2m_invalid:
case p2m_mmio_dm:
break;
}
-
/* Then restrict with access permissions */
- switch (access)
+ switch ( entry->access )
{
case p2m_access_n:
case p2m_access_n2rwx:
epte->snp = is_iommu_enabled(p2m->domain) && iommu_snoop;
epte->suppress_ve = 1;
- ept_p2m_type_to_flags(p2m, epte, epte->sa_p2mt, epte->access);
+ ept_p2m_type_to_flags(p2m, epte);
if ( (level - 1) == target )
continue;
if ( nt != e.sa_p2mt )
{
e.sa_p2mt = nt;
- ept_p2m_type_to_flags(p2m, &e, e.sa_p2mt, e.access);
+ ept_p2m_type_to_flags(p2m, &e);
}
e.recalc = 0;
wrc = atomic_write_ept_entry(p2m, &epte[i], e, level);
e.ipat = ipat;
e.recalc = 0;
if ( recalc && p2m_is_changeable(e.sa_p2mt) )
- ept_p2m_type_to_flags(p2m, &e, e.sa_p2mt, e.access);
+ ept_p2m_type_to_flags(p2m, &e);
wrc = atomic_write_ept_entry(p2m, &epte[i], e, level);
ASSERT(wrc == 0);
}
iommu_flags )
need_modify_vtd_table = 0;
- ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
+ ept_p2m_type_to_flags(p2m, &new_entry);
}
if ( sve != -1 )