The default value for the "suppress #VE" bit set by set_mem_access()
currently depends on whether the call is made from the same domain (the
bit is set when called from another domain and cleared if called from
the same domain). This patch changes that behavior to inherit the old
suppress #VE bit value if it is already set and to set it to 1
otherwise, which is safer and more reliable.
Signed-off-by: Vlad Ioan Topan <itopan@bitdefender.com>
Signed-off-by: Adrian Pop <apop@bitdefender.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
}
}
- return ap2m->set_entry(ap2m, gfn, mfn, PAGE_ORDER_4K, t, a,
- current->domain != d);
+ /*
+ * Inherit the old suppress #VE bit value if it is already set, or set it
+ * to 1 otherwise
+ */
+ return ap2m->set_entry(ap2m, gfn, mfn, PAGE_ORDER_4K, t, a, -1);
}
static int set_mem_access(struct domain *d, struct p2m_domain *p2m,