Skip to contentSkip to conversation

xenpaging: mmap guest pages read-only

PATCH In review Olaf Hering 2 participants 2 messages Jan 11, 2012 – Feb 20, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenpaging: mmap guest pages read-only

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1326290155 -3600
# Node ID ce095edc4f970b7b1bd6fa223137fc84607b2654 # Parent 17b173dbf8663f44790355b2503cb91f9788b84d
xenpaging: mmap guest pages read-only

xenpaging does not write to the gfn, so map the gfn to page-out in read-only mode.

tools/xenpaging/xenpaging.c +1 -1
diff -r 17b173dbf866 -r ce095edc4f97 tools/xenpaging/xenpaging.c
@@ -584,7 +584,7 @@ static int xenpaging_evict_page(struct x
 
     /* Map page */
     ret = -EFAULT;
-    page = xc_map_foreign_pages(xch, paging->mem_event.domain_id, PROT_READ | PROT_WRITE, &victim, 1);
+    page = xc_map_foreign_pages(xch, paging->mem_event.domain_id, PROT_READ, &victim, 1);
     if ( page == NULL )
     {
         PERROR("Error mapping page %lx", gfn);
#1 lore raw

Olaf Hering writes ("[Xen-devel] [PATCH] xenpaging: mmap guest pages read-only"):

Quoted 4 lines

xenpaging: mmap guest pages read-only

xenpaging does not write to the gfn, so map the gfn to page-out in read-only mode.

(I adjusted it to cope with whitespace changes in xenpaging.c.)

Ian.