@@ -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)
@@ -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);
This function allows Xen to map memory read/write or read-only to the guest memory. Signed-off-by: Julien Grall <julien.grall@linaro.org> --- xen/arch/arm/p2m.c | 11 +++++++++++ xen/include/asm-arm/p2m.h | 5 +++++ 2 files changed, 16 insertions(+)