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

[Xen-devel] [PATCH] x86/p2m: add PoD accounting to set_typed_p2m_entry()



While neither PoD together with pass-through nor PVH are currently
supported we still shouldn't leave in place such latent issues.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Tim Deegan <tim@xxxxxxx>
---
To apply cleanly this needs to have
http://lists.xenproject.org/archives/html/xen-devel/2015-09/msg02719.html 
applied first.

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -941,10 +941,18 @@ static int set_typed_p2m_entry(struct do
 
     P2M_DEBUG("set %d %lx %lx\n", gfn_p2mt, gfn, mfn_x(mfn));
     rc = p2m_set_entry(p2m, gfn, mfn, order, gfn_p2mt, access);
-    gfn_unlock(p2m, gfn, order);
     if ( rc )
         gdprintk(XENLOG_ERR, "p2m_set_entry: %#lx:%u -> %d (0x%"PRI_mfn")\n",
                  gfn, order, rc, mfn_x(mfn));
+    else if ( p2m_is_pod(ot) )
+    {
+        pod_lock(p2m);
+        p2m->pod.entry_count -= 1UL << order;
+        BUG_ON(p2m->pod.entry_count < 0);
+        pod_unlock(p2m);
+    }
+    gfn_unlock(p2m, gfn, order);
+
     return rc;
 }
 



Attachment: x86-p2m-typed-entry-PoD.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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