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

[Xen-devel] [PATCH v3 27/38] arm/p2m: Introduce p2m_lookup_attr



The function "p2m_lookup_attr" allows to lookup the mfn, memory type,
access rights, and page order corresponding to a domain's gfn.

Signed-off-by: Sergej Proskurin <proskurin@xxxxxxxxxxxxx>
---
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Julien Grall <julien.grall@xxxxxxx>
---
v3: Change function prototype of "p2m_lookup_attr" by removing the
    function parameter "unsigned int *mattr", as it is not needed by the
    callers.

    Change function prototype of "p2m_lookup_attr" by changing the
    parameter of type xenmem_access_t to p2m_access_t.
---
 xen/arch/arm/p2m.c        | 15 +++++++++++++++
 xen/include/asm-arm/p2m.h | 10 ++++++++++
 2 files changed, 25 insertions(+)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1d3df0f..cef05ed 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -429,6 +429,21 @@ mfn_t p2m_lookup(struct domain *d, gfn_t gfn, p2m_type_t 
*t)
     return ret;
 }
 
+mfn_t p2m_lookup_attr(struct p2m_domain *p2m,
+                      gfn_t gfn,
+                      p2m_type_t *t,
+                      p2m_access_t *a,
+                      unsigned int *page_order)
+{
+    mfn_t ret;
+
+    p2m_read_lock(p2m);
+    ret = p2m_get_entry(p2m, gfn, t, a, page_order);
+    p2m_read_unlock(p2m);
+
+    return ret;
+}
+
 int guest_physmap_mark_populate_on_demand(struct domain *d,
                                           unsigned long gfn,
                                           unsigned int order)
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index e02f69e..384ef3b 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -196,6 +196,16 @@ void p2m_dump_info(struct domain *d);
 /* Look up the MFN corresponding to a domain's GFN. */
 mfn_t p2m_lookup(struct domain *d, gfn_t gfn, p2m_type_t *t);
 
+/*
+ * Lookup the MFN, memory type, access rights, and page table level
+ * corresponding to a domain's GFN.
+ */
+mfn_t p2m_lookup_attr(struct p2m_domain *p2m,
+                      gfn_t gfn,
+                      p2m_type_t *t,
+                      p2m_access_t *a,
+                      unsigned int *page_order);
+
 /* Remove an altp2m view's entry. */
 int remove_altp2m_entry(struct p2m_domain *p2m,
                         gfn_t gfn,
-- 
2.9.0


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

 


Rackspace

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