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

[Xen-devel] [PATCH 3/6] xentrace: P2M lookup suport for ARM platform



From: bensanda <ben.sanda@xxxxxxxxxxxxxxx>

Modified p2m_lookup() to provide support for xentrace on the ARM platform. 
Added check for DOMID_XEN which skips PFN to MFN translation. xentrace sends a 
MFN dirrectly when requesting DOMID_XEN, so no translation is needed. Also sets 
page memory type, p2m_type_t, to p2m_ram_rw to provide correct access.

Signed-off-by: Benjamin Sanda <ben.sanda@xxxxxxxxxxxxxxx>
---
 xen/arch/arm/p2m.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index a2a9c4b..2e7da43 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -228,10 +228,21 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, 
p2m_type_t *t)
     paddr_t ret;
     struct p2m_domain *p2m = &d->arch.p2m;
 
-    spin_lock(&p2m->lock);
-    ret = __p2m_lookup(d, paddr, t);
-    spin_unlock(&p2m->lock);
-
+    /* Check for DOMID_XEN: If we are called with DOMID_XEN (from xentrace)
+    then paddr is already a MFN and no translation is needed. We only set the 
+    page type as p2m_raw_rw and return the MFN directly */
+    if(DOMID_XEN != d->domain_id)
+    {
+        spin_lock(&p2m->lock);
+        ret = __p2m_lookup(d, paddr, t);
+        spin_unlock(&p2m->lock);
+    }
+    else
+    {
+        *t = p2m_ram_rw;
+        ret = paddr;
+    }
+    
     return ret;
 }
 
-- 
2.7.2


_______________________________________________
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®.