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

[Xen-devel] [PATCH v3 3/3] x86/mm: Fix p2m_set_suppress_ve



On a new altp2m view the p2m_set_suppress_ve() func will fail with invalid mfn
from p2m->get_entry() if p2m->set_entry() was not called before.

This patch solves the problem by getting the mfn from hostp2m.

Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index d38d7c29ca..aee82f814d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2982,6 +2982,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool 
suppress_ve,
     p2m_access_t a;
     p2m_type_t t;
     int rc;
+    bool found_in_hostp2m;
 
     if ( altp2m_idx > 0 )
     {
@@ -2999,7 +3000,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool 
suppress_ve,
     if ( ap2m )
         p2m_lock(ap2m);
 
-    mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL);
+    mfn = altp2m_get_gfn_type_access(p2m, gfn, &t, &a, NULL, 
&found_in_hostp2m);
     if ( !mfn_valid(mfn) )
     {
         rc = -ESRCH;
-- 
2.17.1

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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