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

[Xen-devel] [PATCH 2/3] xen/arm: p2m: add guest_physmap_add_page_rw



This function allows Xen to map memory read/write or read-only to the
guest memory.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 xen/arch/arm/p2m.c        | 11 +++++++++++
 xen/include/asm-arm/p2m.h |  5 +++++
 2 files changed, 16 insertions(+)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index fdbb07b..0c515e1 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -267,6 +267,17 @@ int guest_physmap_add_page(struct domain *d,
                               mfn << PAGE_SHIFT, MATTR_MEM, 1);
 }
 
+int guest_physmap_add_page_rw(struct domain *d,
+                              unsigned long gpfn,
+                              unsigned long mfn,
+                              unsigned int page_order,
+                              bool_t rw)
+{
+    return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT,
+                              (gpfn + (1 << page_order)) << PAGE_SHIFT,
+                              mfn << PAGE_SHIFT, MATTR_MEM, rw);
+}
+
 void guest_physmap_remove_page(struct domain *d,
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order)
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index c660820..250f916 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -54,6 +54,11 @@ int guest_physmap_add_page(struct domain *d,
                            unsigned long gfn,
                            unsigned long mfn,
                            unsigned int page_order);
+int guest_physmap_add_page_rw(struct domain *d,
+                              unsigned long gfn,
+                              unsigned long mfn,
+                              unsigned int page_order,
+                              bool_t rw);
 void guest_physmap_remove_page(struct domain *d,
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order);
-- 
1.8.3.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®.