From: Vlad Ioan Topan Date: Wed, 12 Sep 2018 07:50:00 +0000 (+0200) Subject: x86/mm: change default value for suppress #VE in set_mem_access() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=eea4ec2b66dad87ec745778ab9f00e12ef0f2760;p=people%2Fiwj%2Fxen.git x86/mm: change default value for suppress #VE in set_mem_access() 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 Signed-off-by: Adrian Pop Acked-by: Tamas K Lengyel --- diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index a8b3e99ec4..c980f1744d 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -285,8 +285,11 @@ int p2m_set_altp2m_mem_access(struct domain *d, struct p2m_domain *hp2m, } } - 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,