The level passed to ept_invalidate_emt corresponds to the EPT entry
passed as the mfn parameter, which is a pointer to an EPT page table,
hence the entries in that page table will have one level less than the
parent.
Fix the call to atomic_write_ept_entry to pass the correct level, ie:
one level less than the parent.
Fixes: 50fe6e73705 ('pvh dom0: add and remove foreign pages')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>.
* also for their subtrees needing P2M type re-calculation.
*/
static bool_t ept_invalidate_emt(struct p2m_domain *p2m, mfn_t mfn,
- bool_t recalc, int level)
+ bool_t recalc, unsigned int parent_level)
{
int rc;
ept_entry_t *epte = map_domain_page(mfn);
e.emt = MTRR_NUM_TYPES;
if ( recalc )
e.recalc = 1;
- rc = atomic_write_ept_entry(p2m, &epte[i], e, level);
+ rc = atomic_write_ept_entry(p2m, &epte[i], e, parent_level - 1);
ASSERT(rc == 0);
changed = 1;
}