xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Mohamad Rezaei <mmrezaie@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: changing attributes of a page!
Date: Tue, 10 Jan 2012 09:37:09 +0000	[thread overview]
Message-ID: <20120110093709.GA81891@ocelot.phlegethon.org> (raw)
In-Reply-To: <CAK6aU6idWKayh6bAEkBo4vSt4HWKQneYEDLVEQfYxusC=HUrRA@mail.gmail.com>

Hi, 

Please don't top-post. 

At 14:41 +0330 on 09 Jan (1326120068), Mohamad Rezaei wrote:
> I have started Dom0 with dom0_shadow=1. So it must be running with a
> read-only page table. I thought p2m is responsible for updating the
> dom0's page-table.

PV guests don't have p2m in the hypervisor -- they take care of their
own p2m translations and make pagetables that already point to machihe
addresses.

> I have looked at _sh_propagate() but I couldn't
> find any option to change page attributes like RWX.

Look again. :)  That function makes the PTE that the hardware will
see.  So all you need to do is mask _PAGE_RW out of the sflags when you
see an l1 entry where target_mfn is one of the MFNs you're protecting.
Look at how log-dirty is handled, for example. 

Of course, once you've done that, you also need to handle the pagefaults
that will happen if the guest writes to that memory!

Tim.

      reply	other threads:[~2012-01-10  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09  6:52 changing attributes of a page! Mohamad Rezaei
2012-01-09 10:09 ` Tim Deegan
2012-01-09 11:11   ` Mohamad Rezaei
2012-01-10  9:37     ` Tim Deegan [this message]

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=20120110093709.GA81891@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=mmrezaie@gmail.com \
    --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).