[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/mm: change default value for suppress #VE in set_mem_access()



commit eea4ec2b66dad87ec745778ab9f00e12ef0f2760
Author:     Vlad Ioan Topan <itopan@xxxxxxxxxxxxxxx>
AuthorDate: Wed Sep 12 09:50:00 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Sep 12 16:34:07 2018 +0200

    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 <itopan@xxxxxxxxxxxxxxx>
    Signed-off-by: Adrian Pop <apop@xxxxxxxxxxxxxxx>
    Acked-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/mem_access.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.