@@ -1262,19 +1262,15 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame,
unsigned int flags, unsigned int cache_flags)
{
int rc;
+ bool_t rw;
if ( cache_flags || (flags & ~GNTMAP_readonly) != GNTMAP_host_map )
return GNTST_general_error;
- /* XXX: read only mappings */
- if ( flags & GNTMAP_readonly )
- {
- gdprintk(XENLOG_WARNING, "read only mappings not implemented yet\n");
- return GNTST_general_error;
- }
+ rw = !(flags & GNTMAP_readonly);
- rc = guest_physmap_add_page(current->domain,
- addr >> PAGE_SHIFT, frame, 0);
+ rc = guest_physmap_add_page_rw(current->domain,
+ addr >> PAGE_SHIFT, frame, 0, rw);
if ( rc )
return GNTST_general_error;
else
Use guest_physmap_add_page_rw to map the page in the guest with a specific read-write attribute. Signed-off-by: Julien Grall <julien.grall@linaro.org> --- xen/arch/arm/mm.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)