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

[Xen-devel] [v7][RFC][PATCH 07/13] xen/x86/p2m: introduce p2m_check_reserved_device_memory



This can be used conveniently in many cases later.

Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>
---
 xen/include/asm-x86/p2m.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 90ddd15..934324e 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -713,6 +713,19 @@ extern int arch_grant_map_page_identity(struct domain *d, 
unsigned long frame,
                                  bool_t writeable);
 extern int arch_grant_unmap_page_identity(struct domain *d, unsigned long 
frame);
 
+/* Check if we are accessing rdm. */
+static inline int p2m_check_reserved_device_memory(xen_pfn_t start,
+                                                   xen_ulong_t nr, void *d)
+{
+    unsigned long *gfn = d;
+    xen_pfn_t end = start + nr;
+
+    if ( *gfn >= start && *gfn <= end )
+        return 1;
+
+    return 0;
+}
+
 #endif /* _XEN_P2M_H */
 
 /*
-- 
1.9.1


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