]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/mm: change default value for suppress #VE in set_mem_access()
authorVlad Ioan Topan <itopan@bitdefender.com>
Wed, 12 Sep 2018 07:50:00 +0000 (09:50 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 12 Sep 2018 14:34:07 +0000 (16:34 +0200)
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>
xen/arch/x86/mm/mem_access.c

index a8b3e99ec4a7051ad5afc17b6a16d8f45240573e..c980f1744de7afd30739eb1841be2f8e8534c6ab 100644 (file)
@@ -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,