xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Subject: mark pages in p2m_ram_paging_out state read-only
Date: Mon, 14 Nov 2011 17:53:02 +0100	[thread overview]
Message-ID: <20111114165302.GA6688@aepfle.de> (raw)


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;

             reply	other threads:[~2011-11-14 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 16:53 Olaf Hering [this message]
2011-11-24 11:38 ` mark pages in p2m_ram_paging_out state read-only Tim Deegan
     [not found] <mailman.1616.1322135934.12970.xen-devel@lists.xensource.com>
2011-11-24 17:09 ` Andres Lagar-Cavilla
2011-11-24 17:22   ` Tim Deegan
2011-11-24 18:24     ` Olaf Hering
2011-11-24 18:40       ` Olaf Hering
2011-11-24 18:41       ` Andres Lagar-Cavilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111114165302.GA6688@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).