WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] mark pages in p2m_ram_paging_out state read-only

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] mark pages in p2m_ram_paging_out state read-only
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 14 Nov 2011 17:53:02 +0100
Delivery-date: Mon, 14 Nov 2011 08:53:53 -0800
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1321289598; l=1088; s=domk; d=aepfle.de; h=Content-Type:MIME-Version:Subject:To:From:Date:X-RZG-CLASS-ID: X-RZG-AUTH; bh=OimOK4VQdyzne9VuCdk6e0GNgpg=; b=QWwssS5qFVl9G9UP3I+MAoWO6wY1nByIbWlG+lYxKWkhBak8Cp6gnndr7LQf90NvPPq 7t9SJxxBIzsDjTERVO6Cd26+Q8xTlFe0Gtwpni0Tlpm+VytH4euSuf4GUc1d7ACbLT1DR SJISaDXAlIBMm7Z7qXp9wkYCE1KrXkJ/Z/8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21.rev5535 (2011-07-01)
I was wondering why ept_p2m_type_to_flags() removes all permissions from
a gfn in state p2m_ram_paging_out. If the guest happens to read or
execute from that page while the pager writes that gfn to disk, wouldnt
it be enough to remove the write bit to prevent writes from the guest?
If the page is read-only the guest could continue to make progress until
the gfn is really evicted and the p2mt changes to p2m_ram_paged.

I havent actually tried the patch below, but is there any reason it
would break the guest?


diff -r ed809663f829 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -75,7 +75,6 @@ static void ept_p2m_type_to_flags(ept_en
         case p2m_invalid:
         case p2m_mmio_dm:
         case p2m_populate_on_demand:
-        case p2m_ram_paging_out:
         case p2m_ram_paged:
         case p2m_ram_paging_in:
         case p2m_ram_paging_in_start:
@@ -92,6 +91,7 @@ static void ept_p2m_type_to_flags(ept_en
             break;
         case p2m_ram_logdirty:
         case p2m_ram_ro:
+        case p2m_ram_paging_out:
         case p2m_ram_shared:
             entry->r = entry->x = 1;
             entry->w = 0;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] mark pages in p2m_ram_paging_out state read-only, Olaf Hering <=